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.
Hello, I have a matrix with a column of counts by ship via type. I would like to calculate each row's percent of the total, i.e.
10 PDC ISSUE % is 2 / 1307 = 0.15%
I can't seem to come up with a calulation which will give me the grand total count at each row level to use as the denominator. Every search I've done on this comes up with ways if the values are sums but they don't work if the values are counts. Is there a way?
SHIP_VIA | Count | Percent |
01 PDC ISSUE | 2 | 100.00% |
10 UPS BLUE LABEL | 8 | 100.00% |
21 FEDX 1D AIR | 2 | 100.00% |
25 FEDX 2D ECON | 4 | 100.00% |
26 DO NOT SHIP | 11 | 100.00% |
2G UPS GRD TRAC | 107 | 100.00% |
36 UPS 1D AIR | 7 | 100.00% |
42 FEDX 1D PRIOR COL | 16 | 100.00% |
4U UPS 1D 0800 COL | 1 | 100.00% |
4X UPS 1D SAVER COL | 3 | 100.00% |
52 FEDX 2D COL | 10 | 100.00% |
5B UPS 3D SELECT COL | 10 | 100.00% |
5W FEDX SAVER COL | 9 | 100.00% |
6F FEDX EXP SAVER | 1 | 100.00% |
6K FDX FRT PR COL | 3 | 100.00% |
BS SAIA MOTORS PPD | 1 | 100.00% |
BW FDX LTL FRT ECO | 2 | 100.00% |
D5 FDX FRT ECO COL | 1 | 100.00% |
DE UPS STD GRD COL | 18 | 100.00% |
F8 FEDX GRD BILL REC | 358 | 100.00% |
H8 FEDX STD 1D | 3 | 100.00% |
JM FEDX GRD PPD | 118 | 100.00% |
L3 FEDX STD OVNT COL. | 22 | 100.00% |
M2 UPS GRD COL | 524 | 100.00% |
M3 UPS 1D AIR COL | 31 | 100.00% |
M4 UPS 2D COL | 33 | 100.00% |
Q7 UPS 3DAY SELECT | 2 | 100.00% |
1307 |
Solved! Go to Solution.
Hi,
Assuming count is a measure, write this additional measure
=[Count]/CALCULATE([Count],ALL(Data[SHIP_VIA]))
Format this measure as %.
Hope this helps.
Can you add Count again to your Values and then just right click, Show As, Percent of Grand Total?
Hi,
Assuming count is a measure, write this additional measure
=[Count]/CALCULATE([Count],ALL(Data[SHIP_VIA]))
Format this measure as %.
Hope this helps.
Thank you Ashish, this worked and it finally helped me understand the ALL function.
You are welcome.
@Anonymous -
Is this what you need?
Measure =
SUM ( TableName[Count] )
/ CALCULATE (
SUM ( TableName[Count] ),
ALL ( TableName[SHIP_VIA] )
)
Proud to be a Super User!
Chris, your suggestion did not work for me. I'm counting string Ship Via codes and your formula came back saying it could not sum text values.
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |