Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone,
I need to use SWITCH only for cases where there are FILTER values.
For example, the function SWITCH:
SWITCH(
TRUE(),
[Sales%] <0, "Less than 0%",
[Sales%] <= 0.1, "0%-10%",
[Sales%] >= 0.1, "10% or more"
)
The function should only be calculated if the following conditions apply for a given sales order:
[Sales$] >= 0,
[Sales#] >= 0
Is it at all possible to create a measure that will perform these calculations?
Translated with DeepL
I am not sure switch is the right Dax function here. What exactly do you want to achieve with your code?
but in general when you want to use a filter on some dax code you do it like this.
calculate([code], [Sales$] >= 0, [Sales#] >= 0)
I hope this helps.
@Misq , Try like
if([Sales$] >= 0 && [Sales#] >= 0 ,
SWITCH(
TRUE(),
[Sales%] <0, "Less than 0%",
[Sales%] <= 0.1, "0%-10%",
[Sales%] >= 0.1, "10% or more"
), blank())
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
64 | |
51 | |
39 | |
26 |
User | Count |
---|---|
84 | |
57 | |
45 | |
44 | |
35 |