Forum Discussion

Username1848's avatar
Username1848
Frequent Visitor
2 years ago
Solved

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...
  • Arul's avatar
    Arul
    2 years ago

    Username1848 ,

    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.