我有一张如下表:
Country, Advertiser, Brand, Spend
C1, A1, B1, 10
C1, A1, B2, 5
C1, A2, B3, 0
C1, A2, B4, 20
C2, A1, B1, 8
C2, A1, B5, 7
C2, A2, B6, 4
C2, A2, B3, 3
C2, A2, B7, 2
C2, A3, B8, 9
我想获得国家品牌的DISTINCT COUNT
,简单来说就是:
C1 => 4
C2 => 6
如何在Power BI
中创建可嵌入表格或树形图中的度量?我已经尝试过了:
Measure = COUNTX(DISTINCT(sourceTable),sourceTable[Brand])
每个国家/地区返回品牌总数(不是DISTINCT COUNT
)...
我也在下面试过,但它不起作用:
DistinctBrandCount =
CALCULATE(DISTINCTCOUNT(SampleDataForDashboard[Brand]),
GROUPBY(SampleDataForDashboard, SampleDataForDashboard[Country]))
答案 0 :(得分:3)