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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jimbobshandy
Frequent Visitor

Running Total that shouldn't work but does - please help explain!!

Thought I was getting my head around dax but this simple measure (on a model I've inherited) has bamboozled me as I don't think it should work correctly, but it does... I'm not satisfied accepting that it works, I really need to understand why!!

This is a running total for 'Finish' dates that has been placed on a scorecard. I want the measure to ignore any slicer filters on the Calendar[Year] - a connected date table (that is not marked as a date table).  When a user selects the year 2019, it still counts everything in up until 30 April 22 (e.g. counting items in 2019, 2020, 2021 and 2022) which is what I want... but how does it do this without an ALL(Calendar) ??? 

Calculate(count('Schedule'[Activity ID]),'Calendar'[Date]<=date(2022,4,30),'Schedule'[Date Type]="Finish")


It would appear that the bit in red is unaffected by the 2019 filter provided by the slicer. Is there something stopping filter transition? Just to confirm I've checked 'interactions' - the scorecard should defintely by effected by the slicer.

Thanks in advance, this is bugging me so much!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @jimbobshandy 
First of all, you have to remember that filters are in fact tables. And your code replaces the date filter (the VLAUES of 'Calendar'[Date] which is in fact a table) with a constant table containing all the dates from the start up to Apr. 30, 2022. In this case there is nothing that can can affect this table and no matter what you select it will remain the the same.

1.png

View solution in original post

3 REPLIES 3
jimbobshandy
Frequent Visitor

Hi @tamerj1 , thanks so much for the rapid response!

 

You've made that much clearer in my mind, I never thought of that as a table, so thank you.

Taking this a little further, the bit I was struggling with is why in this article there is a measure that uses an ALL() - see the bit i've highlighted in green. This was an approach I've always used but maybe this is largely redundant as I guess maybe this is explained by the section highlighted in red (I must admit I just noticed this!)? My model uses this approach - a datetime relationship - hence I can omit the ALL(). 

jimbobshandy_0-1652270208799.png

 

 Taken from: Computing running totals in DAX - SQLBI

Thanks again for your help 🙂

Absolutely correct

tamerj1
Super User
Super User

Hi @jimbobshandy 
First of all, you have to remember that filters are in fact tables. And your code replaces the date filter (the VLAUES of 'Calendar'[Date] which is in fact a table) with a constant table containing all the dates from the start up to Apr. 30, 2022. In this case there is nothing that can can affect this table and no matter what you select it will remain the the same.

1.png

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors