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

Cumulative dax doesnt return correct values.

Hi Guys,

 

I really need your help. Below you see mine DAX code which will give me Anti cumulative data. Unfortunatelly when I use this DAX then as you can see I dont get the correct result. I tried this DAX code in another file with simple test data and this worked perfectly.

This means that mine code works. But the question is why does this not work in mij data model?

Below you see a couple of information about mine data model en DAX code.

CR72021_0-1648477657563.png

 

This is the 2 tables which I am talking about. There is not a date table. the date columns are in dim trade table. dim_trade_surrkey is the PK and FK.

CR72021_1-1648477742961.png

 

Thanks in advance!

 



 

3 REPLIES 3
Anonymous
Not applicable

Hi guys,

 

I think I am almost there. Obviously I need to use Allselected instead of ALL then I am getting the right result. There is only one thing that I really dont understand.

Below you see 2 tables in both tables I have Year and trade_number as hierarchy. In table 1 I have a filter which is saying face value must be greater then 0. As you can see then I dont get the running total/cumulative. And in table 2 there is not a filter for face value. and the running total works correctly. 
CR72021_0-1648543719090.png

But when I remove trade_number and the filter of face value is greater then 0 is active then the running total works too. So why is that I really dont understand?!
CR72021_1-1648544128957.png

Thanks in advance!



 

 



Ashish_Mathur
Super User
Super User

Hi,

There should be a Date column in the Fact Table as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Anonymous , Try like example

 

calculate(Sum(Table[Value]), filter(all(Table), Table[Year] <= Max(Table[Year]) ) )

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.