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
Anonymous
Not applicable

YTD Attrition %age

Hi - I have to create the attrition %age..

 

Already have date relation date and created measures for hires,month end HC and seperations 

 

The calculation for attr. %age is  - (Sum of exits/Average headcount) (*12/no of month)

Excel calualtion is below

 

MonthHCAvergae HCSum of ExitNo of MonthTotal MonthYTD Attrition %age
Oct900900811210.67%
Nov9309151021211.80%
Dec9219172331217.88%
Jan870905.25141213.92%
Feb877899.6 (Oct to Feb average)5051224.54% = sum of exit i.e. 92/average hc i.e. 899.6 *12/5

 

 

My powerbi table have columns as 

 

Month end - Id- Hire Date- LWd

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

First you need to create a dim_date table in your date model. Then you can use the following measure for average HC:

 

Measure =
IF (
    ISBLANK ( [HC] ),
    BLANK (),
    CALCULATE (
        [HC],
        FILTER ( ALL ( Dim_Date ), Dim_Date[Date] <= MAX ( Dim_Date[Date] ) )
    )
        / CALCULATE (
            DISTINCTCOUNT ( Dim_Date[Month] ),
            FILTER ( ALL ( Dim_Date ), Dim_Date[Date] <= MAX ( Dim_Date[Date] ) )
        )
)

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Average HC is not coming correct .. what can be the reason for that ?

Hi @Anonymous ,

 

First you need to create a dim_date table in your date model. Then you can use the following measure for average HC:

 

Measure =
IF (
    ISBLANK ( [HC] ),
    BLANK (),
    CALCULATE (
        [HC],
        FILTER ( ALL ( Dim_Date ), Dim_Date[Date] <= MAX ( Dim_Date[Date] ) )
    )
        / CALCULATE (
            DISTINCTCOUNT ( Dim_Date[Month] ),
            FILTER ( ALL ( Dim_Date ), Dim_Date[Date] <= MAX ( Dim_Date[Date] ) )
        )
)

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@Anonymous , with date table measures like these can help

Avg HC  = AverageX(values(Date[Month Year]),[HC])

 

Average HC ytd = calculate([Avg HC], datesytd(Date[Date], "9/30"))

 

Sum of exit Ytd= calculate([Sum_of_exit], datesytd(Date[Date], "9/30"))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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.