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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

How to calculate cumulative total and running rate

Hello Team,

 

I have excel in below format, 

Avian_0-1734946836771.png

 

I am able to calculate Running Rate and cumulative count in Excel, but some how I am not replicate same in PowerBI,  Please let me know what I am missing here.

 

Thanks in Advance

Avian

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for Kedar_Pande's concern about this issue.

 

Hi, @Anonymous 

I am glad to help you.

 

Perhaps you can refer to my DAX, I hope that helps:


First create Measure Cumulative Count :

Cumulative Count = 
CALCULATE(
    SUM('Table'[Count]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Year-Mon] <= MAX('Table'[Year-Mon])
    )
)

 

vfenlingmsft_2-1735017369768.png

 


Then create a Measure Running Rate:

Running Rate = 
DIVIDE(
    SUMX(
        FILTER(
            ALLSELECTED('Table'),
            'Table'[Year-Mon] <= MAX('Table'[Year-Mon])
        ),
        'Table'[Status1] + 'Table'[Status2] + 'Table'[Status3] + 'Table'[Status4]
    ),
    [Cumulative Count]
)

 

vfenlingmsft_1-1735017337763.png

 

I have attached the pbix file for this example below, hope it helps.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
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

3 REPLIES 3
Anonymous
Not applicable

Thanks for Kedar_Pande's concern about this issue.

 

Hi, @Anonymous 

I am glad to help you.

 

Perhaps you can refer to my DAX, I hope that helps:


First create Measure Cumulative Count :

Cumulative Count = 
CALCULATE(
    SUM('Table'[Count]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Year-Mon] <= MAX('Table'[Year-Mon])
    )
)

 

vfenlingmsft_2-1735017369768.png

 


Then create a Measure Running Rate:

Running Rate = 
DIVIDE(
    SUMX(
        FILTER(
            ALLSELECTED('Table'),
            'Table'[Year-Mon] <= MAX('Table'[Year-Mon])
        ),
        'Table'[Status1] + 'Table'[Status2] + 'Table'[Status3] + 'Table'[Status4]
    ),
    [Cumulative Count]
)

 

vfenlingmsft_1-1735017337763.png

 

I have attached the pbix file for this example below, hope it helps.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Kedar_Pande
Super User
Super User

@Anonymous 

Create measures:

Cumulative Count = 
CALCULATE(
SUM('YourTable'[Count]), // Replace 'YourTable' with your actual table name
FILTER(
ALL('YourTable'[Year-Mon]), // Adjust to your date column
'YourTable'[Year-Mon] <= MAX('YourTable'[Year-Mon])
)
)
Running Rate = 
VAR CumulativeCount = [Cumulative Count]
VAR PreviousCumulativeCount =
CALCULATE(
SUM('YourTable'[Count]),
FILTER(
ALL('YourTable'[Year-Mon]),
'YourTable'[Year-Mon] < MAX('YourTable'[Year-Mon])
)
)
RETURN
IF(
CumulativeCount = 0,
0,
DIVIDE(CumulativeCount, PreviousCumulativeCount + CumulativeCount, 0)
)

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Anonymous
Not applicable

Hello Kedar,

 

Thanks for sample code. Here is the latest update

============It is working correct
Cumulative Count = CALCULATE(
SUM('Table1'[Count]),
FILTER (
ALL ('Table1'[YearMonthSorting]), 'Table1'[YearMonthSorting] <= MAX ('Table1'[YearMonthSorting])))

 

================================== This one is not correct, running rate info giving incorrect result
Running Rate =
VAR CumulativeCount = [Cumulative Count]
VAR PreviousCumulativeCount =
CALCULATE(
SUM('Table1'[Count]),
FILTER(
ALL('Table1'[YearMonthSorting]),
'Table1'[YearMonthSorting] < MAX('Table1'[YearMonthSorting])
)
)
RETURN
IF(
CumulativeCount = 0,
0,
DIVIDE(CumulativeCount, PreviousCumulativeCount + CumulativeCount , 0)
)

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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