Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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!
Solved! Go to Solution.
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.
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().
Taken from: Computing running totals in DAX - SQLBI
Thanks again for your help 🙂
Absolutely correct
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
8 |