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
Tantanarsenal
Frequent Visitor

How do I cumulate this?

Hi, 

 

I am a beginner at DAX and could need some help...

I have created this code: 

NrOfNegative= CALCULATE (
    DISTINCTCOUNT ( Total[ReferencePeriod] ),
    FILTER ( Total, Total[ChangeDAX] < 0 )
)
 
Where I got the number of months where the change is negative. However, I would like it to cumulate and I can't seem to do that...

Could someone please help me?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Tantanarsenal ,

Try a new measure on top of this using date table

Cumm = CALCULATE(SUMX(values('Date'[date]), [NrOfNegative]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

 

Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42

 

You can also consider Window function

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Tantanarsenal ,

Try a new measure on top of this using date table

Cumm = CALCULATE(SUMX(values('Date'[date]), [NrOfNegative]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

 

Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42

 

You can also consider Window function

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Thank you! I tried your code but switched all to allselected and it worked! 🙂

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.