Forum Discussion

RyotNomad's avatar
RyotNomad
Frequent Visitor
6 years ago

Use an if statement to replace values returned by a table

I have a table with a column that contains only 1 or 0. However when I put this into my pie chart my legend shows 1 and 0. I cannot change the values in the table adn I'd prefer not to create a new table. I'm new to DAX so I tried this:

 

Measure = IF('applicant'[col] = 1, "Yes", "No")

 

But that doesn't work. Could someone guide me on how to fix this?

7 Replies

  • az38's avatar
    az38
    Community Champion

    Hi RyotNomad 

    try to create a Column with the same statement, not a measure 

    • RyotNomad's avatar
      RyotNomad
      Frequent Visitor

      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

      • az38's avatar
        az38
        Community Champion

        RyotNomad 

        you have a good and correct statement

         = IF('applicant'[col] = 1, "Yes", "No")

        please, show text of Error