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'm relatively new to PowerBI and having a little trouble wih the syntax for transposing a nested IF statement from Excel.
My Excel formula reads:
=IF(H2="NULL", "None" , IF(H2>B2,"Late", IF((I2<-7), "Early", "Good" )))
Trying to follow logic from previous posts, but seeminly always coming up with a syntax error.
Any help would be greatly appreciated!
Solved! Go to Solution.
Hi @Anonymous
You should provide some sample data in a format which people can copy, otherwise we are doing with our imagination...not sure if you want to add a custom column in M or DAX, modify the Table name and Column name accordingly
here is M - Power Query Custom Column, you click Add Column -> Custom Column in GUI
if [H] = null then "None"
else if [H]>[B] then "Late"
else if [I] <-7 then "Early"
else "Good"
here is DAX Calculated column
Column = IF(ISBLANK([H]),"None",
IF([H]>[B],"Late",IF([I]<-7,"Early","Good")))
Hi @Anonymous ,
Please have a try.
Create a measure.
Measure = var null_ = IF(SELECTEDVALUE('Table'[H2])=BLANK(),"None",IF(SELECTEDVALUE('Table'[H2])>SELECTEDVALUE('Table'[B2]),"late",IF(SELECTEDVALUE('Table'[I2])<-7,"Early","Good")))
return null_
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You should provide some sample data in a format which people can copy, otherwise we are doing with our imagination...not sure if you want to add a custom column in M or DAX, modify the Table name and Column name accordingly
here is M - Power Query Custom Column, you click Add Column -> Custom Column in GUI
if [H] = null then "None"
else if [H]>[B] then "Late"
else if [I] <-7 then "Early"
else "Good"
here is DAX Calculated column
Column = IF(ISBLANK([H]),"None",
IF([H]>[B],"Late",IF([I]<-7,"Early","Good")))
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 |
---|---|
141 | |
109 | |
107 | |
74 | |
61 |
User | Count |
---|---|
266 | |
127 | |
119 | |
100 | |
88 |