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 am trying to create a new column using an IF statement. If the column 'Survey Type' = AML Quantitative then return with the value in column 'Status'. In the status column there are various answers such as 'Completed', 'Not Started' or 'Compliance Review 4 in progress' etc. That is the value I would like to return. Below is the if statement with no syntax errors.
When hit 'Ok' it says: 'Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.' When I change IF to if I get the following message:
I remove the ) but it doesn't change anything. I am new to this so any help would be appreciated.
Solved! Go to Solution.
Hi @AnjaD
In M, I think you need to use if conditional in this way:
IF <condition> then <ResultTrue> else <ReturnFalse>
So if I'm not wrong, you should write:
IF [Survey Type]="AML Quantitative" then [Status]
Anyway, taking into account the error given, the problem is you are missing a ")", so you need to add it, not to remove it
@mlsx4 thank you very much. I figured it out. You saved my day!!
IF [Survey Type]="AML Quantitative" then [Status] else ""
You're welcome! I'm glad it works now
I tried that and now I get this error:
Not sure how to fix that.
Hi @AnjaD
In M, I think you need to use if conditional in this way:
IF <condition> then <ResultTrue> else <ReturnFalse>
So if I'm not wrong, you should write:
IF [Survey Type]="AML Quantitative" then [Status]
Anyway, taking into account the error given, the problem is you are missing a ")", so you need to add it, not to remove it
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 |
---|---|
109 | |
78 | |
70 | |
52 | |
50 |
User | Count |
---|---|
120 | |
120 | |
76 | |
62 | |
61 |