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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.