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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mariomyhanh
Helper I
Helper I

Headcount growth rate

Good afternoon, 

 

I'm trying to figure out a dax to calculate the growth % year over year for each dept  with the sample query below.

 

I created a clustered column chart to show # of distinct position each year by department using a  query with similar headings below.

 

I would like to create a formula to show growth % year over year within each dept when hovering over certain year (sample graph i would like to show below).  Please help.  Thank you

 

 

mariomyhanh_0-1675706874534.png

 

1 ACCEPTED SOLUTION

Hi,

I think my sample model is simpler than yours.

In order to get previous year's numbers in your model, please try using relevant column from Dim Date table.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

7 REPLIES 7
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1675710823751.png

 

Position # count: = 
COUNTROWS( VALUES(Data[Position #]) )

 

Position # count YoY: =
VAR _currentyear = [Position # count:]
VAR _prevyear =
    CALCULATE ( [Position # count:], FY[FY] = MAX ( FY[FY] ) - 1 )
RETURN
    DIVIDE ( _currentyear - _prevyear, _prevyear )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Is there a way to count position # using distinct count? for example, if there's a repeated position number in the same fiscal year to only count it once. I tried this forumula

DistinctCountofPosition = DISTINCTCOUNT('Staffing Roster'[Position])
 

and it works in a table, but when i try to add it to the dax provided for YoY% it will not work.

Position # count YoY: =
VAR _currentyear = [DistinctCountofPosition]
VAR _prevyear =
    CALCULATE ( [DistinctCountofPosition], FY[FY]= MAX ( FY[FY] - 1 )
RETURN
    DIVIDE ( _currentyear - _prevyear, _prevyear )

please help

Hi,

thank you for your message.

I am not sure but please check if you missed to insert  ")" like the below.

 

Position # count YoY: =
VAR _currentyear = [DistinctCountofPosition]
VAR _prevyear =
    CALCULATE ( [DistinctCountofPosition], FY[FY] = MAX ( FY[FY] ) - 1 )
RETURN
    DIVIDE ( _currentyear - _prevyear, _prevyear )

 

Or, please share your sample pbix file's link, and then I can try to look into it to come up with a more accurate solution.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you so much for your help and patience.  here is the link to the sample data. I hope you are able to access it.  

 

Sample Headcount growth rate data.pbix

Hi,

Thank you for your link, but I cannot accesss to it.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Unfortunately, i am not able to share the file. So sorry. When adding the YoY to the value field table (see below) it returns 0 for all the  FY YoY.  . I hope this helps. Thank you so much again.

   

 

 

 

Hi,

I think my sample model is simpler than yours.

In order to get previous year's numbers in your model, please try using relevant column from Dim Date table.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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