Forum Discussion

Kjaer's avatar
Kjaer
New Member
4 years ago
Solved

If function

I have a table like this I want to make a new measure  But it doesn´t work. I get this error-message: A single value for the 'item' column in the 'test' table cannot be determined. Thi...
  • AlexisOlson's avatar
    4 years ago

    This code should work if you are writing a calculated column that has the row context to make sense of it.

     

    However, for a measure, it doesn't automatically know which row you're referring to when you write "test[item]", so you need to use an aggregation like MAX or SELECTEDVALUE like this:

    IF ( SELECTEDVALUE ( test[item] ) = "A", 1, 0 )