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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Evita_2023
Regular Visitor

Cumulative Turnover Rate Wrong Sequence

Hi,

I have 2 tables in Power BI Desktop - Employees & Date Table. 

I have calculated measure for Turnover Rate saved in Date table. 

I want to calculate Cumulative Turnover rate for selected period so that I can create a line visual where it displays cumulative Turnover rate. 
Please see below desired result:

Evita_2023_3-1691259771638.png

 


I have an issue:
1. When I don't set up the filter, it calculates correctly, but from all data, not from selected time period. Please see below code and result (I am adding TurnoverRate in results for comparisson):

Cumulative Turnover Rate =
CALCULATE (
    SUMX ( 'Date', [TurnoverRate] ),
    FILTER ( ALL ( 'Date' ), [Date] <= MAX ( [Date] ) )
)
Evita_2023_2-1691259671016.png

i have used this formula from previuous posts. 

2. When I specify filter, it gives me incorrect order. Please see code and results:


Cumulative Turnover Rate =
VAR SelectedMonths =
    FILTER(
        ALL('Date'),
        'Date'[Date] >= MIN('Date'[Date])
    )
RETURN
    SUMX(
        SelectedMonths,
        [TurnoverRate]
    )

Evita_2023_0-1691259029275.png

I need to turn it around. Below is desired result:
April: 0.93
May: 1.44 (0.93 + 0.51)
June: 2.83 (0.93 + 0.51 + 1.40)
July: 4.02 (0.93 + 0.51 + 1.40 + 1.19)
August: 4.31 (0.93 + 0.51 + 1.40 + 1.19 + 0.30)


3. When I specify Date range then there is no cumulative rate by selected month. Please see below code and result:

Cumulative Turnover Rate =
VAR SelectedMonths =
    FILTER(
        ALL('Date'),
       'Date'[Date] >= MIN('Date'[Date]) && 'Date'[Date] <= MAX('Date'[Date])
    )
RETURN
    SUMX(
        SelectedMonths,
        [TurnoverRate]
    )
Evita_2023_1-1691259298006.png

 

Can you please be so kind and advise? 
There must be simple tweak, but even ChatGP couldn't help. 

Thank you
3 REPLIES 3
Anonymous
Not applicable

Hi @Evita_2023 ,

 

Please try:

Cumulative Turnover Rate 2 = 
VAR __lastdate =
    MAX ( 'Date'[Date] )
VAR __firstdate =
    MIN ( 'Date'[Date] )
VAR __lastdatewithvalue =
    CALCULATE ( MAX ( 'Table'[Date] ), REMOVEFILTERS () )
VAR __result =
    IF (
        __firstdate <= __lastdatewithvalue,
        CALCULATE (
            CALCULATE (
                SUMX ( 'Date', [TurnoverRate] ),
                FILTER (
                    ALL ( 'Date' ),
                    'Date'[Date] >= MIN ( 'Date'[Date] )
                        && 'Date'[Date] <= MAX ( 'Date'[Date] )
                )
            ),
            'Date'[Date] <= __lastdatewithvalue,
            VALUES ( 'Date'[Date] )
        )
    )
RETURN
    __result

vcgaomsft_0-1691388452124.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hi Gao,
I hacve tried, but I still get the same result.
In your snapshot of table, you can see that turnover rate doesn't grow by months.

Please see below desired result:

Evita_2023_0-1691397258553.png

 


April: 0.93
May: 1.44 (0.93 + 0.51)
June: 2.83 (0.93 + 0.51 + 1.40)
July: 4.02 (0.93 + 0.51 + 1.40 + 1.19)
August: 4.31 (0.93 + 0.51 + 1.40 + 1.19 + 0.30)

foodd
Super User
Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (1,459)