Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have created two different mesaures to have overall count and TypeCount by grouping.
Mesaure :
Raw Data :
Product | Type |
A | X |
B | Y |
C | Z |
D | X |
E | X |
Expected Output in Table/Matrix :
Type | TypeCount | Overall Total | % of Total |
X | 3 | 5 | 60 |
Y | 1 | 5 | 20 |
Z | 1 | 5 | 20 |
But getting Output in Table/Matrix when adding the Type :
Type | TypeCount | Overall Total | % of Total |
X | 3 | 3 | 100 |
Y | 1 | 1 | 100 |
Z | 1 | 1 | 100 |
Can you please help me to acheive my desired output
Hi @ravikzm ,
Here are the steps you can follow:
Single group statistics::
1. Create calculated table.
Table =
var _count1=COUNT('Row Data'[Type])
var _1=COUNTX(ALL('Row Data'),'Row Data'[Type])
var _2=
SUMMARIZE('Row Data','Row Data'[Type],
"Type Count",COUNT('Row Data'[Type]),
"Overall",COUNTX(ALL('Row Data'),'Row Data'[Type]))
return _2
2. Create calculated column.
percen = DIVIDE('Table'[Type Count],'Table'[Overall])
3. Result.
Multiple statistical groups:
1. Create calculated table.
Table 2 =
var _count1=COUNT('Row Data'[Type])
var _1=COUNTX(ALL('Row Data'),'Row Data'[Type])
var _2=
SUMMARIZE('Row Data','Row Data'[Week],'Row Data'[Type],
"Type Count",COUNT('Row Data'[Type]),
"Overall",COUNTX(ALL('Row Data'),'Row Data'[Type]))
return _2
2. Create calculated column.
Percen =
DIVIDE('Table 2'[Type Count],'Table 2'[Overall])
3. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@ravikzm ,
I am getting the expected results
Measure = count('Table (3)'[Type])
Measure 2 = CALCULATE(count('Table (3)'[Type]), ALL('Table (3)'[Type]))
Percen = DIVIDE([Measure],[Measure 2])
Can you please help me to get the correct count when grouping by more than 1 column
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |