Forum Discussion

Werfuks's avatar
Werfuks
Frequent Visitor
3 years ago
Solved

Calculate the deviation between two columns

Dear Experts, month by month I transfer the workforce into PBI, Now  I have a database with a certain amount of single employees. Every data row show an employee with his name, region, country, location, company, headcount, month, year (e.g. Michael Miller, Americas, USA, Denver, ABC Ltd. , 1, 2023, 05). I already calculated an headcount average measure like that:

HC_Avg=DIVIDE(CALCULATE(SUM(Headcount[HC]),ALLEXCEPT(Country_Location,Country_Location[Region],Country_Location[Country],Country_Location[Location],Country_Location[Company])), DISTINCTCOUNT(Month_Year[Month/Year]))

 

Now I want to calculate the deviation between 2023 to 2022 and tried this simple measure but I failed.

Deviation = CALCULATE(Headcount[HC_Avg], FILTER(Month_Year, [Year=2023)) - CALCULATE(Headcount[HC_Avg], FILTER(Month_Year, [Year=2022))

 

Do you have an idea how I could calculate the deviation between 2022 and 2023?

 

Thank you!

2 Replies