【问题标题】:Get Count of Measure for Aggregate Bins in Power BI获取 Power BI 中聚合 bin 的度量计数
【发布时间】:2020-12-19 11:08:58
【问题描述】:

我有以下数据:

我在 dax 中为 Product Count 和 Amount Total 创建了 2 个度量。

Product Count=DistinctCount(table[Product])

金额总计=sum(table[Amount])

我想显示如下输出:

为此,我使用开关盒创建了 2 个测量产品密度带和数量带。 但我无法获得每个乐队的 id 数。 请帮忙。

【问题讨论】:

    标签: powerbi dax


    【解决方案1】:

    我们需要两个配置表

    Amount Band

    还有 Product Density Band

    现在我们可以定义两个度量来计算配置表选择中的数量和产品数量

    Amount Total Band = 
    COUNTROWS(
        FILTER(
            ALL( 'Table'[Id] ),
            [Amount Total] > MIN( 'Amount Band'[From] )
                && [Amount Total] <= MAX( 'Amount Band'[To] )
        )
    )
    

    Product Count Density Band = 
    COUNTROWS(
        FILTER(
            ALL( 'Table'[Id] ),
            [Product Count] >= MIN( 'Product Density Band'[Product Density Band] )
                && [Product Count] <= MAX( 'Product Density Band'[Product Density Band] )
        )
    )
    

    在表格视觉中与配置表一起使用的这些度量可提供所需的结果

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-28
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-12-18
    • 2023-02-23
    相关资源
    最近更新 更多