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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anouk_ppt
Regular Visitor

Monthly moving cumulative sum

Hi, 

Here is my Power BI file: https://we.tl/t-Z7PKx0RqXe
I'd like to have a table with a monthly cumulative sum for each column (Call Off,  Flux poussé, Flux tiré, Weekly Platinium). Something looking roughly like this for one of the columns:

Month numberDateFlux pousséCumulative Flux poussé
505/05/201955
506/05/20191015
507/05/20191631
606/06/20192525
607/06/2019227
608/06/20191037

 

I've seen another post about this (https://community.powerbi.com/t5/Desktop/Monthly-cumulative-sum/td-p/699637) but I wasn't able to adapt it to my problem... Maybe you will !

Thank you in advance,

Anouk

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @anouk_ppt 

Please see the below.

CALCULATE(
    SUM(YourTable[Flux poussé]),
    FILTER(
        ALLEXCEPT(YourTable, YourTable[Month number]),
        YourTable[Date] <= MAX(YourTable[Date])
    )
)

Regards,
Mariusz

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

Hi @Mariusz 

First of all, thank you for your prompt response !
With your formula I do get a cumulative sum but it doesn't "reset" every month as you can see below. I would like for it to start at 152 028 on May 2nd then at 186 340 (=152 028 + 34312) on May 3rd and so on.

Result.JPG

Hi @anouk_ppt 

Try adding Year like below.

CALCULATE(
    SUM(YourTable[Flux poussé]),
    FILTER(
        ALLEXCEPT(YourTable, YourTable[Annee], YourTable[Mois]),
        YourTable[Date] <= MAX(YourTable[Date])
    )
)



Regards,
Mariusz

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

Hi @Mariusz 

I added the year in the formula just like you showed me but it still doesn't "reset" as you can see on the last line (June 3rd):
Result.JPG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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