Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
SWITCH (
TRUE,
Sales[Net Price] <= 150, 0.15,
Sales[Net Price] <= 1000, 0.2,
Product[Category] = "Audio", 0.13,
0
)
does what you want with regards to the examples you've given. The order of conditions ALWAYS MATTERS but if you order them correctly, you'll get what you want.
"Is there any solution so that switch should go to each and every condition, Order of condition should not matter."
What do you want to do? SWITCH will go to the first condition that is TRUE in the order of their appearance. There's no way around it. Whether you should use SWITCH or not depends on the logic you want to implement. But you have not revealed anything about the logic... so nothing can be advised.
Probably replying to and old question no sure if relevant for the original person but at least would be for the community.
The problem here is that you are not evaluating the full condition.
Based on the logic you want to implement, what you are saying is that if the value is less or equal to 1000 AND is greater than 150 then it's 0.2
and only if the value is less or equal to 150, then the result should be 0.15.
In order to resolve this you need to use an AND condition in your statement to resolve it, like these: