Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm confused with the use of all() and removefilters(). I wonder if someone can give me an explanation about the two calendar filters: all() vs removefilters().
I have written two measures using different calendar filters, in the visual part, I have selected YearMonth in the column filter. In the page filter, I have selected year 2021. The date filters in the measures, page filter and column fields use the same calendar table.
I have put my question in the measure. The visual in attached on the bottom. Thanks for the help in advance.
Solved! Go to Solution.
@Jeanxyz
Not clear about the measures you have used. If you need a good video the refer to this please:
https://www.youtube.com/watch?v=O8S1XoRss28
Also this:
https://www.youtube.com/watch?v=O4co3WFMjfw
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hello Dear ,
Its not as complicated as you may think 🙂
Differences between ALL() and REMOVEFILTERS()
REMOVEFILTERS is just an alias of ALL here, so it works in the same manner.
Basically, using only ALL() returns a table including all rows, ignoring any filters that might have been applied.
However, when ALL is used as a filter argument of CALCULATE / CALCULATETABLE, it behaves differently: it removes filters from the table and does not return a table.
To eliminate this confusing behavior of ALL, REMOVEFILTERS was introduced to replace ALL when it is used inside CALCULATE.
You can find more in this video.Hope it helps!
Hi @Jeanxyz
Have you solved this problem? If yes, could you kindly accept the answer helpful as the solution (or kindly share your solution ). so the others can find it more quickly.
Best Regards,
Community Support Team _Tang
@Jeanxyz
Not clear about the measures you have used. If you need a good video the refer to this please:
https://www.youtube.com/watch?v=O8S1XoRss28
Also this:
https://www.youtube.com/watch?v=O4co3WFMjfw
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks a lot, Fowmy! As usual, you gave me good guidance.
I did a test with a small sales fact table as below and link it to dim_date table. I also created three measures using removefilters(), all(), var respectively. It turns out all() and removefilters() generate the same results, both remove the filter in [Date] column, but if there is filter applied to another column in the Dim_Date table, [Date] field is still filtered. E.g., if I filter year 2021, then only dates in year 2021 are included in measure 1 and measure 2 , dates in year 2020 are not considered.
The last measure however works quite differently, the var DatesSelectionAndEarlier actually ignores any filters related to dim_Date table and calculate dates from the very 1st day in the dim_date table till the last day in the dim_date table.
So the learning here is var functions work seperately from current filtering context and start from the whole table.
Thanks,
So did it solve the problem and your query? 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |