Forum Discussion

giroldoale's avatar
giroldoale
Helper I
5 years ago
Solved

Why If Else Doesn't work?

Hi,

I am not able to get rid off this issue.

I have a column containings 0,1,2 and i need to construct another column giving the text "Completed" once the value is 2 and "NotCompleted"otherwise.

Al my formulas give me no value, I cannot find the error, can you help me?

 

The formula is 

Column=IF(Table1[Value]=2,"Complete","NotComplete") whatever would be the Table1[Value]

 
 

See picture attached...

  • NEWS..

    I've try to simply close and reopen the report and now it's works! 

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi giroldoale 

     

    Can you provide some sample data in a format we can copy (not a picture)? What is your current code, M code?

  • giroldoale  - Can you tell me what is the data type of TestopCompIDDynamic column (Sorry for wrongly typing this column name) ? If it is Text so just update your DAX like below:

    Column = IF(Table[TestopCompIDDynamic] = "2","Completed","Not Completed")

     

  • PC2790's avatar
    PC2790
    Community Champion

    Hello giroldoale ,

     

    what is the data type of the column - TetsOPCompIDynamic?

    It should work if it is set as whole number.

      • PC2790's avatar
        PC2790
        Community Champion

        Is it possible for you to share your pbix file, removing all the sensitive data?