Forum Discussion
Total Employee Count by group
Hello All,
I'm trying to calculate calculate total employee count by group so I can get the % of the Grand Total (ex. level 10 employee count is 100 and total employee count is 350 so the % should be 28.57). Currently though when I try to sum it sums all the numbers (ex. level 10 employee count 100 + 100 + 100 which is 300). This would give me a % of 85.71, this is incorrect.
Any ideas on how to get this to work.
nleuck_101
Please try this measureCount Measure = VAR T1 = SUMMARIZE ( TableName, TableName[Level], "@Count", SUMX ( VALUES ( TableName[Count] ), TableName[Count] ) ) RETURN SUMX ( T1, [@Count] )
14 Replies
- nleuck_101
Continued Contributor
It's not that easy. The top part is the desired results but the bottom part it what I'm actually getting.
- tamerj1
Community Champion
Hi nleuck_101
Please use
New Table = VAR T1 = SUMMARIZE ( TableName, TableName[Level], "@Count", MAX ( TableName[Count] ) ) RETURN ADDCOLUMNS ( T1, "% Count", DIVIDE ( [@Count], SUMX ( T1, [@Count] ) ) )- nleuck_101
Continued Contributor
That only get's me the % of grand total. I still need to display the correct employee count in the visual.
- tamerj1
Community Champion
The column @Count should disply the correct employee count!
- sharpie_dogRegular Visitor
What I have seen is if the the "total" is summed up as a calculation in PBI, then you can right click to select the % versus doing a calculation to get the %; if that makes sense.