Forum Discussion
Duplicate Values shown in slicer caused by Switch Statement
- 9 years ago
hi Anonymous
I think it somehow has to do with the nested SWITCH inside your SWITCH.
What I would do in your situation is to do this in the Query Editor and create a conditional column. Because it applies the conditions from top to bottom you can easily add change it from your [Description] column to your [ParentId] column.
In doing so it will then have all your required states in one column, so that when loaded into the Power BI data model, the slicer will only see it as a standard column and not as a calculated column.
hi Anonymous
I think it somehow has to do with the nested SWITCH inside your SWITCH.
What I would do in your situation is to do this in the Query Editor and create a conditional column. Because it applies the conditions from top to bottom you can easily add change it from your [Description] column to your [ParentId] column.
In doing so it will then have all your required states in one column, so that when loaded into the Power BI data model, the slicer will only see it as a standard column and not as a calculated column.
I know this thread is marked as solved and pretty much dead, but wanted to revive for some insight.
I had a very similar issue extracting slicer values from a calculated column with a far less complicated IF statement thatn the nested SWITCH used in this example. After refreshing my dashboard one day, the 3 values created from the IF were duplicated in the slicer and duplicated in the filter pane, but in the Table View dropdown filter there were only the 3 values I intentionally created. Makes no sense...
I duplicated the calculated column - literally by Ctrl+A, copy & paste into a new calculated column, and the problem is 100% solved.
I would categorize this as a glitch...