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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
rr_her2555
New Member

Cummulative Sum of Total cost saved by month

Hello, I'm currently working on cummulative sum and was stucked in this requirement. This must be working on a line chart which shows line is going upward. Hoping someone might help me into this.

rr_her2555_0-1709271964311.png

My expected output is in the picture.
I tried,
1. CALCULATE>>FILTER>>ALL>>DATETABLE<=MAX

2. VAR>>RETURN>>SUMX>>FILTER>>ALL>>

But still doesnt give me the output I need. Hoping someone might know the solution.

 

Thanks for taking your time

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rr_her2555 ,

Please follow the steps below to get the culmulative values:

1. Please DO NOT create any relationship between your fact table and date dimension table

2. Create a measure as below to get it

Total Commulative Sum =
VAR _date =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Cost Save] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Go LiveDate] <= _date )
    )

In addition, you can refer the following links to get it.

How to Calculate Cumulative Values with DAX - Microsoft Fabric Community

Cumulative sum in Power BI: CALCULATE, FILTER and ALL | by Samuele Conti | Medium

CALCULATE(
  SUM(Sales[Revenue]),
  FILTER(
    ALL(Sales),
    Sales[SaleDate] <= MAX(Sales[SaleDate])
  )
)

vyiruanmsft_0-1709530846647.png

Best Regards

View solution in original post

5 REPLIES 5
MKY
Frequent Visitor

I have seen the above article and it did help me to compute Cummulative using Calculate & All functions. I would like to be able to still use the filters. Using the above example if the table also contains column like brands, country, reporting month, plan/actual etc, how can I use the cummulative when I select a brand or country or any combination there of.

Musadev
Resolver III
Resolver III

Hi @rr_her2555 
can you elaborate on your problem statement? You have a single table with products, Go Live date, and cost_save.
There will be a DIm_date table as well. Your output is for a single month, right?

Hi @Musadev yes, I have a date table. output must be the total cumulative cost saved of products by month.

Anonymous
Not applicable

Hi @rr_her2555 ,

Please follow the steps below to get the culmulative values:

1. Please DO NOT create any relationship between your fact table and date dimension table

2. Create a measure as below to get it

Total Commulative Sum =
VAR _date =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Cost Save] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Go LiveDate] <= _date )
    )

In addition, you can refer the following links to get it.

How to Calculate Cumulative Values with DAX - Microsoft Fabric Community

Cumulative sum in Power BI: CALCULATE, FILTER and ALL | by Samuele Conti | Medium

CALCULATE(
  SUM(Sales[Revenue]),
  FILTER(
    ALL(Sales),
    Sales[SaleDate] <= MAX(Sales[SaleDate])
  )
)

vyiruanmsft_0-1709530846647.png

Best Regards

MKY
Frequent Visitor

I have seen the above article and it did help me to compute Cummulative using Calculate & All functions. I would like to be able to still use the filters. Using the above example if the table also contains column like brands, country, reporting month, plan/actual etc, how can I use the cummulative when I select a brand or country or any combination there of.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.