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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
MiKeZZa
Post Patron
Post Patron

Running Total in DAX -> ignoring other filters

I've made a DAX measure

 

cumulative months per client =
CALCULATE( DISTINCTCOUNT('fact table'[unique clients per month] ) ,
FILTER(
ALL('date'[date]),
'date'[date] <= MAX('date'[date])))
 
This works great and gives by example:
 
Filter: yearmonth = 201801
 
Cust    Dim field 1    Value
42       Option 1       10
42       Option 2       4
 
Now we want a measure that gives by example 12; that is calculated as 10 + 4 but 2 months are overlapping each other. So it must be ignoring any chosen fields from any of the dimensions except of cause client and date.
 
We can achieve what we want by doing this in DAX:
 
cumulative months total duration per client =
CALCULATE([cumulative months per client],ALL(dim[dim field 1]))
 
But this is definitely not the way; we have to call every object in every dim. That's not the solution we guess. But using an ALL doesn't the trick either; because of it is ignoring the client and date. So it gives us a total over all clients and dates.
 
So we're almost there but we miss the last percent.
1 ACCEPTED SOLUTION
MiKeZZa
Post Patron
Post Patron

I've solved this:

 

cumulative months total per client =
if([cumulative months per client]=0,BLANK(),
CALCULATE([cumulative months per client],ALLEXCEPT('table','client'[clientid],'date'[month year]))
)
 

View solution in original post

1 REPLY 1
MiKeZZa
Post Patron
Post Patron

I've solved this:

 

cumulative months total per client =
if([cumulative months per client]=0,BLANK(),
CALCULATE([cumulative months per client],ALLEXCEPT('table','client'[clientid],'date'[month year]))
)
 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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