Forum Discussion
Use an if statement to replace values returned by a table
Hi. Could you show me how the DAX would look? I've clicked create new column and then used col = IF(Applicant[col], "Yes","No) but I get an error on the Yes saying it's invalid
you have a good and correct statement
= IF('applicant'[col] = 1, "Yes", "No")
please, show text of Error
- RyotNomad6 years agoFrequent VisitorThe syntax for "Yes" is incorrect. (DAX(IF( (Applicant[X6_13]) = 1. "Yes", "No"))).My actual column name is X6_13. I don't know why it's putting a full stop after the 1. It's clearly a comma in my DAX statementMy exact Code:Column= IF( (Applicant[X6_13]) = 1, "Yes", "No")
- Anonymous6 years agoNot applicable
Hi RyotNomad,
What type of value existed in your 'x6_13' field? Please check it to use the correct value in your if statement: (you can't directly use equal operator to compare with text and number value)
Number version:
Column = IF ( Applicant[X6_13] = 1, "Yes", "No" )Text version:
Column = IF ( Applicant[X6_13] = "1", "Yes", "No" )Notice: please also check your calculated column data type if it does not recognize as a text value.
If above not helps, can you please share more detail information about your scenario?
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
- RyotNomad6 years agoFrequent Visitor
Unfortunately neither of those worked.
I'm not sure what you mean by the calcualted column data type being recognized as a text value.
I've included a screenshot of the data.
Every table is linked to applicant via foreign id