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
Hello Everyone,
I'm trying to do an IF (AND( DAX command within PowerBI and when I create a custom column and type the following it comes back with no errors.
But when I apply it, it comes back with a error with IF
I've tried almost every thinkable command possible and can't seem to figure out why it doesn't like IF, if, else if.
What I'm trying to do is similar to the excel command of =IF(AND($P8="Service Targets Breached",$K8<$O8),"Yes","")
Your wisdom is appreciated!
Solved! Go to Solution.
Hi @affan
That didn't resolve the issue so I did some searching and the following worked for me
= Table.AddColumn(#"Removed Duplicates2", "SLM Justification", each if [SLM Status] = "Service Targets Breached" and [Last Resolved Date]<[#"Due Date/Time"] then "Justified" else null)
Found it kinda funny becuase I think I typed that a million times and it came back with errors.
Thanks for you help!
Hi @affan
That didn't resolve the issue so I did some searching and the following worked for me
= Table.AddColumn(#"Removed Duplicates2", "SLM Justification", each if [SLM Status] = "Service Targets Breached" and [Last Resolved Date]<[#"Due Date/Time"] then "Justified" else null)
Found it kinda funny becuase I think I typed that a million times and it came back with errors.
Thanks for you help!
That's because you are entering DAX when you should be using M...you shouldn't do that...
Hi @smashbroski
Please try the below DAX
IF([SLM Status]="Service Target Breached",
IF([Last Resolved Date]<[#"Due Date/Time"], "Justified",null),null)
If this does not work please share your sample file.
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan Farooqi
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 August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
79 | |
71 | |
48 | |
41 |
User | Count |
---|---|
138 | |
108 | |
71 | |
64 | |
58 |