The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I need help with an if Formual. I have a colum that contains a value. I need to "rate" that value based on if.
If MU Diff >0,1
If MU Diff > .5,2
If MU Diff >1,3
If MU Diff >2,4
otherwise 0
What is the DAX Equivleant of that?
You're not too far away.
The syntax for nested IFs in DAX can begin to look messy but you just need some additional commas to separate the clauses.
More importantly, you need to reverse the IF clauses in this case because you will only get two value comparisons using the current order : is MU greater than 0? if yes, then return 1, and the second clause will never get tested for positive numbers e.g. if MU is 0.75
so the DAX should look something like
Column = if (MU Diff > 2, 4, IF (MU Diff > 1, 3, IF (MU Diff > 0.5, 2, 0)))
I deliberately missed a clause for you to put in
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 |
---|---|
58 | |
32 | |
20 | |
16 | |
15 |
User | Count |
---|---|
79 | |
32 | |
30 | |
24 | |
21 |