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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Edirin
Regular Visitor

Attrition Rate for Same Period Last Year

Is there any way to calculate / compare the attrition rate for the sam month as last year? For example April 2024 vs April 2023. I'm try to show them in a card visual and have it update each month. What i'm getting just seems to show the whole of 2023. Is this possible?

 

Edirin_0-1715155148641.png

 

2 ACCEPTED SOLUTIONS
v-jiewu-msft
Community Support
Community Support

Hi @Edirin ,

Based on my testing, please try the following methods as workaround:

1.Create the simple table.

vjiewumsft_0-1715221650773.png

2.Create the new measure to calculate current year attrition.

 

current year attrition = 
VAR tota = CALCULATE (
        SUM ('Table'[Number]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY())
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR _attri = CALCULATE (
        SUM ('Table'[Attrition]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY())
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR result = DIVIDE(_attri, tota)
RETURN
result

 

3.Create the new measure to calculate last year attrition.

 

Lat year attrition = 
VAR tota = CALCULATE (
        SUM ('Table'[Number]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY()) - 1
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR _attri = CALCULATE (
        SUM ('Table'[Attrition]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY()) - 1
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR result = DIVIDE(_attri, tota)
RETURN
result

 

4.Change the two measures format to the percentage.

vjiewumsft_1-1715221686326.png

5.Drag the measure into the Multi-row card visual. The result is shown below.

vjiewumsft_2-1715221713159.png

Best Regards,

Wisdom Wu

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

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This pattern should work

Attrition SPLY = calculate([Total attrition],sameperiodlastyear(calendar[date]))

Ensure that in the slicer you drag Year and Month name from the Calendar table and select a month there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

This pattern should work

Attrition SPLY = calculate([Total attrition],sameperiodlastyear(calendar[date]))

Ensure that in the slicer you drag Year and Month name from the Calendar table and select a month there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-jiewu-msft
Community Support
Community Support

Hi @Edirin ,

Based on my testing, please try the following methods as workaround:

1.Create the simple table.

vjiewumsft_0-1715221650773.png

2.Create the new measure to calculate current year attrition.

 

current year attrition = 
VAR tota = CALCULATE (
        SUM ('Table'[Number]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY())
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR _attri = CALCULATE (
        SUM ('Table'[Attrition]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY())
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR result = DIVIDE(_attri, tota)
RETURN
result

 

3.Create the new measure to calculate last year attrition.

 

Lat year attrition = 
VAR tota = CALCULATE (
        SUM ('Table'[Number]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY()) - 1
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR _attri = CALCULATE (
        SUM ('Table'[Attrition]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] = YEAR(TODAY()) - 1
                && 'Table'[Month] = MONTH(TODAY())
        )
    )
VAR result = DIVIDE(_attri, tota)
RETURN
result

 

4.Change the two measures format to the percentage.

vjiewumsft_1-1715221686326.png

5.Drag the measure into the Multi-row card visual. The result is shown below.

vjiewumsft_2-1715221713159.png

Best Regards,

Wisdom Wu

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.