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

Help with Cumlative Total please

Hi 

I am trying to write a dax to create a cummlative total but is isnt working - can anyone help please?

 

I have the following table  - in the cumlative column I want it to total up as I have manually inserted below.

 

The total Headcount measure is  as follows 

 

Total Headcount = DISTINCTCOUNT('MASTER FILE'[EMP ID])
 
In the Table "Master FIle" there is a ID number which it is doing a disctinct count on and returning this against a date column called "report month"
 
I have tried a running total Quick measure and it just isnt totalling as I want it - any help please?

 

Report MonthTotal HeadcountCumlative Total

01 April 2023

18931893
01 May 202319133806
01 June 202319115717
01 July 202318977614

 

I have tried this 

 

Running total = CALCULATE(sumx(values('Calendar'[Report Month]),[Total Headcount]),Filter(All('Calendar'),'Calendar'[Report Month] <= max('Calendar'[Report Month])))
 
But the output is this?
 
Report MonthTotal HeadcountRunning total
01/04/2023189318317
01/05/2023191320230
01/06/2023191122141
01/07/2023189724038
01/08/2023186625904
01/09/2023186227766
01/10/2023183129597
3 REPLIES 3
Anonymous
Not applicable

Thank you all for you help - I managed to get it working by using the following:- 

 

SUMX(FILTER(ALLSELECTED('Calendar'[Report Month]), 'Calendar'[Report Month]<= MAX('Calendar'[Report Month])),CALCULATE(DISTINCTCOUNT('MASTER FILE'[Headcount])))
Anonymous
Not applicable

Hi @Anonymous ,

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jihwan_Kim
Super User
Super User

Hi, I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

 

Running total =
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER (
                ALLSELECTED ( 'Calendar' ),
                'Calendar'[Report Month] <= MAX ( 'Calendar'[Report Month] )
            ),
            'Calendar'[Report Month]
        ),
        "@result", [Total Headcount]
    ),
    [@result]
)

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
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 community update carousel

Fabric Community Update - June 2025

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