The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Solved! Go to Solution.
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])
)
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])
)
Hi @Carpetperson ,
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
Hello @Carpetperson ,
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
Hi @divyed thank you for your response, your dax does the same as mine, it only ignores the first filter not that second one.
@Carpetperson ,Try using
Max Outsourced Market Size =
CALCULATE(
MAXX(
VALUES(Verticals[V1]),
CALCULATE(
[Market Size Supply Chain] - [Market Size Outsourced],
REMOVEFILTERS(Verticals)
)
),
REMOVEFILTERS(Verticals)
)
Proud to be a Super User! |
|
Hi @bhanu thank you for your response, your dax does the same as mine, it only ignores the first filter not that second one.
hi @Carpetperson ,
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])
)
HI @FreemanZ thank you for your response, this gives the similar output, without ignoring the second filter.
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
14 | |
8 | |
5 |