Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

ALL is not working as expected

Hello all

 

I have a Line Chart with 2 lines. They are both measures. I also have a slicer that filters the data on the field "TotalDistance". What I need to do is to remove the filter from one of the measures on the Line Chart. So I created a new measures and used ALL to remove the filter on "Total Distance":

 

DriverScore_forTrends = CALCULATE(Scorecard[DriverScore], ALL(Scorecard[TotalDistance])).
 
Note: Scorecard[DriverScore] is a measure
 
Unfortunately, I cant see differences between the previous measure (DriverScore) and this one (DriverScore_forTrends) when I interact with the slicer. 
 
What am I missing?
 
Thanks

3 Replies

  • Anonymous , Make sure that the measure DriverScore is correctly defined and that it is being affected by the TotalDistance filter.

    Ensure there are no other filters or slicers that might be affecting the DriverScore measure.

    f all the above checks are in place and you still do not see any differences, you might want to try an alternative approach using REMOVEFILTERS:

     

    DriverScore_forTrends = CALCULATE(
    Scorecard[DriverScore],
    REMOVEFILTERS(Scorecard[TotalDistance])
    )

  • Anonymous's avatar
    Anonymous
    Not applicable

    bhanu_gautam thanks for your answer.

    DriverScore is affected by TotalDistance for sure.

    But I actually have more filters acting on DriverScore. How does this affect the ALL? I thought you could keep the other filters active, while removing the "TotalDistance" one?

     

    I actually have another measure on the same tab that is using ALL, but considering another slicer. And it works as long as I dont interact with the TotalDistance slicer: if that happens, it seems like ALL stops working

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Thanks bhanu_gautam  for the quick reply. Allow me to add some thoughts:

     

    If you want to keep all other filters except for "TotalDistance", you can use ALLEXCEPT:

    DriverScore_forTrends = CALCULATE(Scorecard[DriverScore], ALLEXCEPT(Scorecard, Scorecard[TotalDistance]))

    Please refer to the following document to understand the difference between ALL, ALLEXCEPT and REMOVEFILTER:

    Power BI DAX: ALL, ALLEXCEPT, ALLSELECTED, REMOVEFILTERS | by Ayşegül Yiğit | Microsoft Power BI | Jun, 2024 | Medium

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.