Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I am looking to create a new measure to include in a table. Say I have 30 categories, and I need to exclude 10 of them on a measure, because this # will be used in multiple visuals, I don't want to exclude in the filter pane of each visual.
I've only seen examples where And/Or are used and those only have 2 logical areas.
Trying something like
CALCULATE(
SUM(FACTS_Service_Per_Category[Price]) ,
AND( FACTS_Service_Per_Category[Category] <> "Product 1",
FACTS_Service_Per_Category[Category] <> "Product 2",
FACTS_Service_Per_Category[Category] <> "Product 3",
FACTS_Service_Per_Category[Category] <> "Product 4",
FACTS_Service_Per_Category[Category] <> "Product 5",
)
Solved! Go to Solution.
Is this what you are looking for?
Measure NOT IN =
CALCULATE(
SUM(Facts[Price]),
FILTER(
Facts,
NOT (Facts[Price]) IN {"P1", P2", "P3", "P4", P5"}
)
)
Regards,
Nathan
No problem. Glad to help!
Is this what you are looking for?
Measure NOT IN =
CALCULATE(
SUM(Facts[Price]),
FILTER(
Facts,
NOT (Facts[Price]) IN {"P1", P2", "P3", "P4", P5"}
)
)
Regards,
Nathan
Yes, thanks!
Guess I have it with nested ANDS. Is there a better way to write this?
CALCULATE (
Sum (
FACTS_Service_Per_Category[Price]),
AND ( FACTS_Service_Per_Category[Category] <> "Product 1",
AND ( FACTS_Service_Per_Category[Category] <> "Product 2",
AND ( FACTS_Service_Per_Category[Category] <> "Product 3",
AND ( FACTS_Service_Per_Category[Category] <> "Product 4",
AND ( FACTS_Service_Per_Category[Category] <> "Product 5",
AND ( FACTS_Service_Per_Category[Category] <> "Product 6",
AND ( FACTS_Service_Per_Category[Category] <> "Product 7", FACTS_Service_Per_Category[Category] <> "Product 8"
)))))))
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |