Forum Discussion
Username1848
2 years agoFrequent Visitor
Return result based on if statement: Error "Single value can't be determined"
Hello, I have a table called “Data”. This table has the three columns “Customer”, “Metric” and “Value”. “Customer” contains customer names in text. “Metric” contains the metric names in text “Va...
- 2 years ago
try this in calculated column,
Score Distribution = SWITCH( TRUE(), 'Table'[Metric] ="Metric 1" && 'Table'[Value] =3 ,"Top Score", 'Table'[Metric] ="Metric 1" && 'Table'[Value] =2 ,"Mid Score", 'Table'[Metric] ="Metric 1" && 'Table'[Value] =1 ,"Low Score", 'Table'[Metric] ="Metric 2" && 'Table'[Value] =3 ,"Top Score", 'Table'[Metric] ="Metric 2" && 'Table'[Value] =2 ,"Mid Score", 'Table'[Metric] ="Metric 2" && 'Table'[Value] =1 ,"Low Score", 'Table'[Metric] ="Metric 3" && 'Table'[Value] =3 ,"Top Score", 'Table'[Metric] ="Metric 3" && 'Table'[Value] =2 ,"Mid Score", 'Table'[Metric] ="Metric 3" && 'Table'[Value] =1 ,"Low Score")I have attached the file for reference.
Arul
2 years agoSuper User
Do you need Measure or Calculated Column?
Username1848
2 years agoFrequent Visitor
Hello, thank you for your reply.
Whatever works to show the result of the IF statement evaluation.
At the end I want to select one customer with a slicer or filter and display the results of only this customer in a table or text field, whatever will work.
- Arul2 years agoSuper User
try this in calculated column,
Score Distribution = SWITCH( TRUE(), 'Table'[Metric] ="Metric 1" && 'Table'[Value] =3 ,"Top Score", 'Table'[Metric] ="Metric 1" && 'Table'[Value] =2 ,"Mid Score", 'Table'[Metric] ="Metric 1" && 'Table'[Value] =1 ,"Low Score", 'Table'[Metric] ="Metric 2" && 'Table'[Value] =3 ,"Top Score", 'Table'[Metric] ="Metric 2" && 'Table'[Value] =2 ,"Mid Score", 'Table'[Metric] ="Metric 2" && 'Table'[Value] =1 ,"Low Score", 'Table'[Metric] ="Metric 3" && 'Table'[Value] =3 ,"Top Score", 'Table'[Metric] ="Metric 3" && 'Table'[Value] =2 ,"Mid Score", 'Table'[Metric] ="Metric 3" && 'Table'[Value] =1 ,"Low Score")I have attached the file for reference.