The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have this if statement:
Solved! Go to Solution.
Try it in a SWITCH statement like this.
AMI30% =
SWITCH (
TRUE (),
'Case'[csAnnualIncomeEntry] <= 27200 && MIN ( 'Case'[csHouseholdSize] ) = 1, "True",
'Case'[csAnnualIncomeEntry] <= 31050 && MIN ( 'Case'[csHouseholdSize] ) = 2, "True",
'Case'[csAnnualIncomeEntry] <= 34950 && MIN ( 'Case'[csHouseholdSize] ) = 3, "True",
"False"
)
Try it in a SWITCH statement like this.
AMI30% =
SWITCH (
TRUE (),
'Case'[csAnnualIncomeEntry] <= 27200 && MIN ( 'Case'[csHouseholdSize] ) = 1, "True",
'Case'[csAnnualIncomeEntry] <= 31050 && MIN ( 'Case'[csHouseholdSize] ) = 2, "True",
'Case'[csAnnualIncomeEntry] <= 34950 && MIN ( 'Case'[csHouseholdSize] ) = 3, "True",
"False"
)
Thank you!!! Good to see the SWITCH in action. Been looking for this fix!!!!
Hello @pbrainard , you can use switch instead of if, when your cases are more than two.
here is the link with details :
SWITCH function (DAX) - DAX | Microsoft Docs
I hope it helps you.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
135 | |
101 | |
89 | |
72 | |
58 |
User | Count |
---|---|
262 | |
120 | |
115 | |
95 | |
82 |