Forum Discussion
Reset INDEX order when data sort does not give the results
- 10 years ago
kfschaefer wrote:
thanks for the code, however, it seems to have and issue with the 4.
I thought you were adding a column in the modeling lab with DAX, the switch is a DAX function.
To add a column with the same logic in the Query Editor which Power Query is used, you can reference below expression.if [live range]="0-100" then 1 else( if [live range]="101-500" then 2 else( if [live range]="501-3000" then 3 else( if [live range]="3000+" then 4 else( if [live range]="New" then 5 else( if [live range]="Runout" then 6 else 999)))))
If you have any question, feel free to let me know.
kfschaefer wrote:
thanks for the code, however, it seems to have and issue with the 4.
I thought you were adding a column in the modeling lab with DAX, the switch is a DAX function.
To add a column with the same logic in the Query Editor which Power Query is used, you can reference below expression.
if [live range]="0-100" then 1 else( if [live range]="101-500" then 2 else( if [live range]="501-3000" then 3 else( if [live range]="3000+" then 4 else( if [live range]="New" then 5 else( if [live range]="Runout" then 6 else 999)))))
If you have any question, feel free to let me know.
The code worked as far as creating a new index renumbering, However, when I attempt to use it as a slicer the fliter order reverts back to the alpha sorting and not on the new index.
I created a table, inserted the two columns LivesRange and SortID, still displaying the correct order, when I change the visualization to Slicer it here where the corrected order is lost.
I changed the Management relationship to have the LivesRange as the first linked to the Lives Range in the PowerBIData table via the LivesRange Name. I would prefer not to have the SORTID displayed on my Visualization.
See attachments:
When I change from table to slicer it reverts.
I am also having the same issue with the Month Slicer.