Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

If DAX calculated column error

Hi Experts

 

I cannot see my error in the following if dax calculated column ...

 

Measure = 
If('Table[Apple] = 1, "Fruit",
If('Table[Apple] = 0 && Table[Value] <> Blank, Table[Value])))

 

getting an erro rmessage "Expression that yields variant data-type cannot be used to define calculated column"

  • Anonymous , Try like

     

    Switch(True(),
    Table[Apple] = 1, "Fruit",
    Table[Apple] = 0 && Table[Value] <> Blank() , Table[Value]& ""
    )

1 Reply

  • Anonymous , Try like

     

    Switch(True(),
    Table[Apple] = 1, "Fruit",
    Table[Apple] = 0 && Table[Value] <> Blank() , Table[Value]& ""
    )