Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
laurent_rio
Helper I
Helper I

Help with Total and Average Measure in table based on year

Hi, 

I have table that filtered based on my date table 

i have measures of calculate active headcount per month and attrition(resign) headcount per month 

Now i want to have calculate annual attrition rate = Total attrition per year / average head count that will dynamic depend on the filter 

average headcount = sum ( headcount every month)/12 

Capture.JPG
Can help me how to get correct measures of Total attrition per year and average headcount ??

Total attrition should be 
attrition headcount 2020 = 95 , 2021 = 3 
average headcount 2020 = sum (active headcount per month during 2020)/12 , similar with 2021 as well 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@laurent_rio , try like

attrition headcount 2020 =

calculate([attrition headcount per month], filter(allselected('Date') , 'Date'[year] = max('Date'[year])))

 

Try one of the three for average headcount 2020 

 

calculate([active headcoun], filter(allselected('Date') , 'Date'[year] = max('Date'[year])))/12


calculate(sumx('Date'[Month-Year]),[active headcoun]), filter(allselected('Date') , 'Date'[year] = max('Date'[year])))/12


calculate(AverageX('Date'[Month-Year]),[active headcoun]), filter(allselected('Date') , 'Date'[year] = max('Date'[year])))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@laurent_rio , try like

attrition headcount 2020 =

calculate([attrition headcount per month], filter(allselected('Date') , 'Date'[year] = max('Date'[year])))

 

Try one of the three for average headcount 2020 

 

calculate([active headcoun], filter(allselected('Date') , 'Date'[year] = max('Date'[year])))/12


calculate(sumx('Date'[Month-Year]),[active headcoun]), filter(allselected('Date') , 'Date'[year] = max('Date'[year])))/12


calculate(AverageX('Date'[Month-Year]),[active headcoun]), filter(allselected('Date') , 'Date'[year] = max('Date'[year])))

Hi @amitchandak 

Brilliant both DAX are work as a charm. For average i use this 

calculate(AverageX('Date'[Month-Year]),[active headcoun]), filter(allselected('Date') , 'Date'[year] = max('Date'[year])))


Thanks for helping

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.