The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All,
I'm attempting to create a custom column using an IF Statement and by Dividing 2 already existing columns.
I have tried the following:
IF([JTD Earned Value] = 0, "1", [JTD Earned Value] / [#"JTD Labour Amount @ Cost"])
And whilst the syntax appears to be correct, I get this error when I click OK.
Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly.
I know i can do this in a measure but I need it as a DAX command to SUM correctly in a Multi-Grid control.
Thanks in advance.
Solved! Go to Solution.
Hi @Sime ,
In Power Query, add a custom column and write this code..
if [JTD Earned Value] = 0 then "1" else [JTD Earned Value] / [JTD Labour Amount @ Cost]
Thank you both for your assistance. Problem rectified.
Hi @Sime ,
In Power Query, add a custom column and write this code..
if [JTD Earned Value] = 0 then "1" else [JTD Earned Value] / [JTD Labour Amount @ Cost]
This part - #"JTD Labour Amount @ Cost" - leads me to think you're in Power Query. Fair enough but you can't write DAX in Power Query. You need to write M and there is an 'if then else' in M.
Does that help?
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |