Forum Discussion
Create an if statement in a measure that returns both text and a column field
- 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.
Hi there Vera
I figured out that I should be doing this in query (which I have made progress with however I still can't get my formula to concatenate data with text.
My formula is fine until I try to concatenate:
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"]
The "OK" is present where the condition is met but there is an error where the condition is not met:
(If I use text ("OK" and "Not OK") for both then it works, however I need to concatenate data to create information for the viewer.)
The error message states:
Expression.Error: We cannot apply field access to the type Function.
Details:
Value=[Function]
Key=Trunks & Radials (RPE).RPE Plan
Thanks for your help and patience in advance.