Forum Discussion
Use an if statement to replace values returned by a table
you have a good and correct statement
= IF('applicant'[col] = 1, "Yes", "No")
please, show text of Error
- 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
- Anonymous6 years agoNot applicable
HI RyotNomad,
Table fields can't direct use in measure formula, it can calculate and compare with aggregate values do you need to use aggregate functions to pack your table fields. (e.g. max, min, sum...)
Power BI DAX Aggregate Functions
Measure= IF ( max(Applicant[X6_13]) = 1, "Yes", "No" )In addition, I'd like to suggest you take a look at the following blog about the difference between the calculated column and measure to help you know more about the difference and usage of these calculated fields:
Calculated Columns and Measures in DAX
Regards,
Xiaoxin Sheng