Forum Discussion
Sort slicer value based on the numeric Value
hi, Anonymous
For your case, you could use this way as below:
Step1:
Add a dim country table that contains the order column
Step2:
Then create a relationship with fact table by Country column
Step3:
Then use Sort by column for dim table:
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
https://radacad.com/sort-by-column-in-power-bi
Step4:
When create the report, use country column from Dim country table as a slicer and Country from fact table in other visual.
and here is sample pbix file, please try it.
Regards,
Lin
- Anonymous6 years agoNot applicable
Did you hard coded the values in DIm_Table where we have all countries? I cant take hard coding as in actual data is in trillions.
Also, Sort by Column should have a single value for each country but my actual data look like this
- v-lili6-msft6 years agoCommunity Support
hi, Anonymous
For the dim country table, you could Duplicate the fact table and then Group By it, and then add a conditional column for sort column in edit queries.
Either way, you need to define the rules in advance.
Regards,
Lin
- Anonymous6 years agoNot applicable
Hello Lin,
I have created a column
1Rank = RANKX(FILTER('Time','Time'[Region M3]=EARLIER('Time'[Region M3])),'Time'[Actual],,DESC,Dense)
but when I am trying to sort my column Region M3 based on 1Rank, I am getting this error
Can you help? I am trying to sort the values in Slicer for Region M3 and Market M15 though they are not getting used in any visuals.