Forum Discussion
Conditional column Based on Switch function - Error
- 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 _bFinal 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.
Hi SriGaG1 ,
Based on your description, it seems that the fields parameter could help you.
Then select the two columns:
Rename these fields:
Then use the parameter to create a visual:
Final output:
For more details, please refer to:
Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn
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.
- SriGaG13 years ago
Helper II
Thank you very much. Seems like its working. But one question before closing this off. How to get the particular column that we wrote in to a dax query? What I meant was, I do need to group them like
if parameter = 1 then "dissatisfied"
elseif parameter = 2 then "dissatisfied"
elseif parameter = 3 then "neutral"
elseif parameter = 4 then "satisfied"
elseif parameter = 5 then "satisfied"
Its a blocker for me. And from your method, we cannot put it to the filters. Andyou give me some points onthe above things.
Thankyouverymuc for your time and effort. v-jianboli-msft
- v-jianboli-msft3 years ago
Community Support
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 _bFinal 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.