Forum Discussion
Make measure ignore specific filter
- 7 years ago
This is not really an issue. It is clearly explained in this article from Alberto. It is happening because of Auto Exist feature in DAX.
Besides, creating a seperate dimension table is not really a workaround, but rather a best practice. A Star Schema is always considered best when working with Power BI Datamodel. This is what makes it more powerful!
Hey guys!
It's dead simple, really. Use the ALL function to remove a filter on a specific column like this:
Measure = calculate(Expression,ALL(column-you-want-to-remove-filter))
That's it. ALL, used inside a CALCULATE expression, works like REMOVEFILTER.
- akshaybanaye2 years agoRegular Visitor
What if the filter is also using a measure (visual level filter)?
- shas2 years agoFrequent Visitor
this does not work anymore
- wagrezy7 years ago
Helper I
Yes, confirmed. It works with Calculate([expression],ALL([column name])).
- Anonymous7 years agoNot applicable
I see a lot of responses that it works with ALL, but no one adresses the specifik problem/bug in my example (download file below to see my example). There I illustrate that in some cases it won't work.
- AkhilAshok7 years ago
Solution Sage
This is not really an issue. It is clearly explained in this article from Alberto. It is happening because of Auto Exist feature in DAX.
Besides, creating a seperate dimension table is not really a workaround, but rather a best practice. A Star Schema is always considered best when working with Power BI Datamodel. This is what makes it more powerful!
- Anonymous6 years agoNot applicable
Hi Greg,
My measure is giving wrong column sub total but correct row sub total.
My Actual Measure in the report:
Measure =VAR Y=CALCULATE(SUMX(VALUES('CurrentTimeEntry Details'),[ActualHours]),ALLSELECTED('Staff Details'[Employee Name])]))VAR X = CALCULATE(SUM ('CurrentTimeEntry Details'[ActualHours]))Return x/Y
Output I am getting:Employee Project1 Project2 Total A 0.3 0 0.3 B 0.21 0.19 0.25(NOT CORRECT) C 0 0.3 0.3 Total 0.51 0.49 1
It is coming wrong as the measure is behaving at the backend like below ie ( Filtering across the project)Measure =VAR Y=CALCULATE(SUMX(VALUES('CurrentTimeEntry Details'),[ActualHours]),ALLSELECTED('Staff Details'[Employee Name]),ALLSELECTED('Project Details'[Complete Project Detail])) <--- FilteringVAR X = CALCULATE(SUM ('CurrentTimeEntry Details'[ActualHours]))Return x/Y
Can you please suggest the solution as I am unable to avoid filtering and fix this - Tjeerd6 years ago
Helper I
Wow, thank you!
I really needed this simplicity for something I am working on right now. I really was searching all over the place in very much too complex challenges and solutions. It really was as simple as the DAS you wrote down.