Forum Discussion
Cannot slice because of function ALL
I am displaying a table below on my report:
The rows are measures calculated from Table T1. The measure used to calculate the bottom row is:
Hi
I'm guessing you could replace the 'ALL(T1)' statement in your measure calculation with the ALLEXCEPT function. As stated in the documentiation (ALLEXCEPT function (DAX) - DAX | Microsoft Learn), this "Removes all context filters in the table except filters that have been applied to the specified columns".So if you replace ALL(T1) with something like ALLEXCEPT(T1, T1[userid]), that would probably do the trick.
Best regards,
Sebastian
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- sebastiandyrbyResolver I
Hi
I'm guessing you could replace the 'ALL(T1)' statement in your measure calculation with the ALLEXCEPT function. As stated in the documentiation (ALLEXCEPT function (DAX) - DAX | Microsoft Learn), this "Removes all context filters in the table except filters that have been applied to the specified columns".So if you replace ALL(T1) with something like ALLEXCEPT(T1, T1[userid]), that would probably do the trick.
Best regards,
Sebastian
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
After some further digging, I discovered that my slicer was user T1[username], not T1[userid]. I added T1[username] in the ALLEXCEPT columns and it worked!
My final query was:
CALCULATE(sum(T1[Count]), FILTER(ALLEXCEPT(T1,T1[userid],T1[username]),T1[dateend] >= SELECTEDVALUE('Date'[WeekEndDate]) - 6&& T1[dateend] <= SELECTEDVALUE('Date'[WeekEndDate]))) - AnonymousNot applicable
Hi Sebastian,
Thanks for your response. I modified the query to:
CALCULATE(sum(T1[Count]), FILTER(ALLEXCEPT(T1,T1[userid]),T1[dateend] >= SELECTEDVALUE('Date'[WeekEndDate]) - 6&& T1[dateend] <= SELECTEDVALUE('Date'[WeekEndDate])))The slicer on userid does not change the numbers in the table.