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 the following DAX formula. This gives me the average headcount as the measure implies for all of the workforce snapshots that append from the files in the folder I get the data from.
Average Headcount = CALCULATE(COUNT('Workforce Snapshots'[Employee Number]),DISTINCT('Workforce Snapshots'[Source.Name]))/DISTINCTCOUNT('Workforce Snapshots'[Source.Name])
Now, I want to get a formula to from the avg headcount get number of employees in each "Grade #". I assume I need to use GROUPBY function. But I can't seem to get it to work. I am trying to use this as I overlay in a stacked and line chart (Terms by grade in colums) and I want to show the number of headcount by grade in the line.
Thanks for any help.
To have your calculation "group by" some columns, you need to use ALLEXCEPT() function in CALCULATE.
Avg HeadCount Per Grade = CALCULATE ( COUNT ( Table1[EmpId] ), DISTINCT ( Table1[Source] ), ALLEXCEPT ( Table1, Table1[Grade] ) ) / CALCULATE ( DISTINCTCOUNT ( Table1[Source] ), ALLEXCEPT ( Table1, Table1[Grade] ) )
Regards,
This would work in a normal visualization. However, when I try to use this measure in the line values of a "Stacked column and Line chart", the line is now a straight line... essentially, the line value in this chart does not concern itself of the axis values
Can you supply sample data? It seems like you could achieve what you want by putting Grade # in the Legend.
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 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |