Forum Discussion
nleuck_101
Continued Contributor
4 years agoTotal 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 % shoul...
- 4 years ago
nleuck_101
Please try this measureCount Measure = VAR T1 = SUMMARIZE ( TableName, TableName[Level], "@Count", SUMX ( VALUES ( TableName[Count] ), TableName[Count] ) ) RETURN SUMX ( T1, [@Count] )
nleuck_101
Continued Contributor
4 years ago
I need to get the sum of the employee in the level. If you look at the original post level 10 has 3 rows. That's because there were two terminations reasons (I messed up and one of those needs to be a different reason like new employer or etc...). I want to get the total employee count of level 10 which is 100 but Power BI is summing up 100 three times becasue there are three entries and I'm getting 300 which is wrong.
tamerj1
Community Champion
4 years agonleuck_101
Please try this measure
Count Measure =
VAR T1 =
SUMMARIZE (
TableName,
TableName[Level],
"@Count", SUMX ( VALUES ( TableName[Count] ), TableName[Count] )
)
RETURN
SUMX ( T1, [@Count] )- nleuck_1014 years ago
Continued Contributor
tamerj1
Thank you! This solution worked as expected.