Forum Discussion
Nest if in m syntax error
I have the following query in M and wanted to know where my syntax issue is wrong:
Original Source = each if [#"Original Source Drill-Down 1"] = "IMPORT"
then "Events" , else if [#"Original Source Drill-Down 1"] = "Salesforce" then "Salesforce", else [Original Source v.1])
Thank you for your help.
Solved. Thank you.
3 Replies
- HotChilli
Community Champion
remove the commas.
To see how powerbi does something like this, use the Column from examples feature. CAn be quite powerful
- ysherriff
Resolver II
Thanks HotChilli
I will try that later but my focus here is the correct syntax for nested if statement in M.
My original query worked: = each if [#"Original Source Drill-Down 1"] = "IMPORT"
then "Events" , else if [#"Original Source Drill-Down 1"] )but when I tried to add the second parameter that is where the error comes from. Any help would be appreciaited as I am trying to learn query writing.
- ysherriff
Resolver II
Solved. Thank you.