Forum Discussion
Dax Maxx function, but ignoring the Filter, and Slicers
I have a calculation that calculates the MAX value of a Measure:
I used the Removefiltes it works but if you filter the actual visual the dax does not work anymore, kind of like a double negative:
My visual is a gauge, that is filter on the side panel on a specific Vertical.
This is my code:
Max Outsourced Market Size = CALCULATE(
MAXX(
VALUES( Verticals[V1] ),
CALCULATE(
[Market Size Supply Chain] - [Market Size Outsourced],
ALLEXCEPT(Verticals, Verticals[V1])
)
),
ALLEXCEPT(Verticals, Verticals[V1])
)
I think it should also ignore the SELECTEDVALUE. Please help anyone.
- Anonymous1 year ago
The solution was to create individual measures for each of the v1's then use the original script, then create the visuals using those individual scripts, then use the maxx function below on the max value of the gauge. Seems the problem is that you cannot ignore two filters in one formula.
Max Outsourced Market Size = CALCULATE( MAXX( VALUES( Verticals[V1] ), CALCULATE( [Market Size Supply Chain] - [Market Size Outsourced], ALLEXCEPT(Verticals, Verticals[V1]) ) ), ALLEXCEPT(Verticals, Verticals[V1]) )
8 Replies
- bhanu_gautam
Super User
Anonymous ,Try using
Max Outsourced Market Size =
CALCULATE(
MAXX(
VALUES(Verticals[V1]),
CALCULATE(
[Market Size Supply Chain] - [Market Size Outsourced],
REMOVEFILTERS(Verticals)
)
),
REMOVEFILTERS(Verticals)
)- AnonymousNot applicable
Hi bhanu thank you for your response, your dax does the same as mine, it only ignores the first filter not that second one.
- FreemanZ
Super User
hi Anonymous ,
try like:
Max Outsourced Market Size =
CALCULATE(
MAXX(
VALUES( Verticals[V1] ),
CALCULATE(
[Market Size Supply Chain] - [Market Size Outsourced],
ALL(Verticals),
VALUES(Verticals[V1])
)
),
ALL(Verticals),
VALUES(Verticals[V1])
)
- divyed
Super User
Hello Anonymous ,
To ignore selectedvalues, have you tried using all ?
Max Outsourced Market Size =
CALCULATE(
MAXX(
VALUES( Verticals[V1] ),
CALCULATE(
[Market Size Supply Chain] - [Market Size Outsourced],
ALL(Verticals[V1]) -- This removes any filters on Verticals[V1]
)
),
ALL(Verticals[V1]) -- Ignores the filter on Verticals[V1] for the outer CALCULATE as well
)I hope this helps .
Cheers
- AnonymousNot applicable
Hi divyed thank you for your response, your dax does the same as mine, it only ignores the first filter not that second one.
- AnonymousNot applicable
Hi Anonymous ,
Can you provide the .pbix file without sensitive data? And show the expected results as a picture?
If you are unsure how to upload data please refer to
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Wenbin Zhou - AnonymousNot applicable
The solution was to create individual measures for each of the v1's then use the original script, then create the visuals using those individual scripts, then use the maxx function below on the max value of the gauge. Seems the problem is that you cannot ignore two filters in one formula.
Max Outsourced Market Size = CALCULATE( MAXX( VALUES( Verticals[V1] ), CALCULATE( [Market Size Supply Chain] - [Market Size Outsourced], ALLEXCEPT(Verticals, Verticals[V1]) ) ), ALLEXCEPT(Verticals, Verticals[V1]) )