Forum Discussion

Toby001's avatar
Toby001
Regular Visitor
2 years ago
Solved

Create simple DAX measure ..

Dear community,
Being a power bi beginner, I am struggling to setup a very simple DAX measure to define 2 icons.
iconMeasure = SWITCH(TRUE(),[SPI]>1,"TriangleHigh","TriangleLow")
SPI is a standard decimal column within a table.
It gives me the error:
The value of SPI could not be evaluated. Either the column doesn't exist or for this column no actual row exists
I appreciate your ideas.
Best Toby
  •  can you try. You need to pass on scalar value and not a column in SWITCH

    SWITCH(TRUE(), MAX(tbl[SPI])....)
    or
    SWITCH(TRUE(), CALCULATE(MAX(tbl[SPI]))....)

    Toby001

     

2 Replies

  • smpa01's avatar
    smpa01
    Community Champion

     can you try. You need to pass on scalar value and not a column in SWITCH

    SWITCH(TRUE(), MAX(tbl[SPI])....)
    or
    SWITCH(TRUE(), CALCULATE(MAX(tbl[SPI]))....)

    Toby001

     

  • HotChilli's avatar
    HotChilli
    Community Champion

    IF there's only 1 case in the SWITCH, use an IF statement.

    I think this will give you a clearer error message.