Forum Discussion
Anonymous
5 years agoNot applicable
Create an if statement in a measure that returns both text and a column field
Totally new to Power BI and just can't get my head around this !! I want to create a Measure that uses an if statement in my Model Table. I can write the if statement ok I just want to return a co...
- Anonymous5 years ago
figured this out. I created a new column within the data environment and used the following syntax (which I guess was the problem all along !!.
= if('Table1'[Field1]='Table1'[Field2],"OK","Check - "&'Table1'[Field1]&" vs "&'Table1'[Field2])
Thanks for all your time and patience. As always, much appreciated.
Anonymous
5 years agoNot applicable
Hi Anonymous
What error did you get? It is better to provide some sample data...if it is a measure, you can't call a field directly...
- Anonymous5 years agoNot applicable
Hi Anonymous
So it is a column, you missed () for the Text.From, but your error was not about it, the question is how you put your if statement? Did you add a custom column in Power Query Editor then put it like this?
if [#"Trunks & Radials (RPE).RPE Plan"]=[#"Loads (Driver Vehicle).Planned_Total_RPE"] then "OK" else "Check - "&Text.From([#"Trunks & Radials (RPE).RPE Plan"])&" vs "&Text.From([#"Loads (Driver Vehicle).Planned_Total_RPE"])