Forum Discussion

joshcomputer1's avatar
9 years ago
Solved

Calculated Column with multiple if or or statements

I need a formula for a caclulated column.  The 'Dataset'[QuestionNum] column has Q1 through Q39 as responses. I need it to categorize these into the following categories.  Is there any easy way to do this without it slowing down performance. 

 

Q1-Q8 = "Call Handling"

Q9-Q14= "Email Handling"

Q15-Q19= "Professional Skills"

Q20-Q39= "Ticket Handling"

 

  • joshcomputer1,

     

    You may refer to the following DAX.

    Column =
    VAR num =
        VALUE ( REPLACE ( 'Dataset'[QuestionNum], 1, 1, "" ) )
    RETURN
        SWITCH (
            TRUE (),
            num <= 8, "Call Handling",
            num <= 14, "Email Handling",
            num <= 19, "Professional Skills",
            num <= 39, "Ticket Handling"
        )
    

1 Reply

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    joshcomputer1,

     

    You may refer to the following DAX.

    Column =
    VAR num =
        VALUE ( REPLACE ( 'Dataset'[QuestionNum], 1, 1, "" ) )
    RETURN
        SWITCH (
            TRUE (),
            num <= 8, "Call Handling",
            num <= 14, "Email Handling",
            num <= 19, "Professional Skills",
            num <= 39, "Ticket Handling"
        )