Forum Discussion

SriGaG1's avatar
SriGaG1
Helper II
3 years ago
Solved

Conditional column Based on Switch function - Error

Hello Experts,   I have an issue in writing a DAX function for the below scenario   I have a custom table wich contains only one single column named "Satisfaction type" and it contains two rows n...
  • v-jianboli-msft's avatar
    v-jianboli-msft
    3 years ago

    Hi SriGaG1 ,

     

    You can add a measure to the visual:

     

    Measure =
    VAR _a =
        SWITCH (
            MAX ( Parameter[Parameter] ),
            "Overall", MAX ( 'Table'[Customer overall Satisfaction Rating] ),
            "Safety", MAX ( 'Table'[Customer Safety Satisfaction Rating] )
        )
    VAR _b =
        SWITCH (
            _a,
            1, "dissatisfied",
            2, "dissatisfied",
            3, "neutral",
            4, "satisfied",
            5, "satisfied"
        )
    RETURN
        _b
    

     

    Final output:

    Besides, this question is beyond the original topic of this thread, so if you still have any other questions, please consider marking the responses that are helpful to you and creating a new thread in order to better help others with similar questions. This will make the post more relevant and will allow more people to help you!

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.