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've been struggling with this for a while now and I simply can't understand why I'm not getting the same numbers in PBI as in excel.
So, I have 2 data tables, 'Employee headcount EOM' with the employees at the end of each month, and 'Raw Data' with the leavers for each month. I need to calculate an annualized attrition trend based on the following logic:
Monthly Average Headcount=(HC EOM previous month+HC EOM Current month)/2
Avg leavers YTD=total leavers YTD/Number of months YTD
Average Monthly Population=Monthly Average Headcount+Avg leavers YTD
Average Average Monthly Population YTD=Sum of Average Monthly Population YTD/Number of Months YTD
Total Leavers YTD=Sum of Leavers YTD
Average Attrition YTD=Total Leavers YTD/Average Average Monthly Population YTD
ANNUALIZED ATTRITION=Average Attrition YTD*12/Number of months YTD
Now my DAX:
Monthly headcount : Headcount = count('Employee headcount EOM'[Name])
Previous month headcount:
I've got my numbers correctly as far as Average Monthly Population and Total Leavers YTD, but once I get into the Average Average Monthly Population YTD, the numbers no longer reflect the same as I get in my excel calculations. The first month is correct for both PBI and excel. But starting May, I get slightly different values for the last 3 measures.
Any ideas why PBI gives me different values?
Solved! Go to Solution.
Hi @RalucaS
Be aware that DAX calculations are based on context this means that a column, a filter, a slicer or any other thing can change the result of the calculations.
When using IF statments on your caclulations things get even funnier because when you go to aggregated levels you may not have the expected result.
Can you please share a mockup data or sample of your PBIX file and expected result (since you have the calculation in excel would be great to have that). You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @RalucaS
Be aware that DAX calculations are based on context this means that a column, a filter, a slicer or any other thing can change the result of the calculations.
When using IF statments on your caclulations things get even funnier because when you go to aggregated levels you may not have the expected result.
Can you please share a mockup data or sample of your PBIX file and expected result (since you have the calculation in excel would be great to have that). You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
96 | |
94 | |
82 | |
70 | |
64 |
User | Count |
---|---|
116 | |
106 | |
94 | |
79 | |
72 |