Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a problem with sorting a slicer in Power BI desktop.
Let's say I have a table with movies, that feeds the slicer in question.
movies:
Title | Box office | Year |
Avengers: Endgame | $2,797,800,564 | 2019 |
Avatar | $2,789,958,507 | 2009 |
Titanic | $2,187,463,944 | 1997 |
Star Wars: The Force Awakens | $2,068,223,624 | 2015 |
Avengers: Infinity War | $2,048,359,754 | 2018 |
And another table with their ratings, related by the Title column:
ratings:
Title | Site | Rating |
Avengers: Endgame | Metacritic | 78% |
Avengers: Endgame | Rotten Tomatoes | 94% |
Avengers: Endgame | IMDB | 85% |
Titanic | Rotten Tomatoes | 92% |
Titanic | IMDB | 91% |
I want to sort the movies by average rating from chosen services.
I tried to make a measure like AvgRating = AVERAGE(ratings[Rating]), and it computes exactly what I wanted, but you cannot sort a slicer by measure.
I also tried making a calculated column in the movies table: AvgRating = AVERAGE(ratings[Rating]), so I can use the "sort by column" option. However, calculated columns in PBI are only refreshed on data load, so the results do not change when I choose different services.
Is there any option to do this kind of thing, or am I doomed?
Thanks in advance!
Solved! Go to Solution.
Hi,
Based on your description, I created data to reproduce the scenario. ‘AvgRatings’ is a column. ‘AvgRating’ is a measure.
AvgRatings = CALCULATE(AVERAGE(ratings[Rating]),RELATEDTABLE(ratings))
AvgRating = AVERAGE(ratings[Rating])
It is unavailable to sort a slicer by measure. As a workaround, you can use the ‘Hierarchical Filter - xViz’ visual from Marketplace and use ‘AvgRating’ measure as value. And in the ‘Fields’, click the ‘drop down’ button and choose ‘show item with no data’.
Result:
If I misunderstand your thought, please show me your expected output, I am glad to solve the problem for you.
Best Regards,
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Based on your description, I created data to reproduce the scenario. ‘AvgRatings’ is a column. ‘AvgRating’ is a measure.
AvgRatings = CALCULATE(AVERAGE(ratings[Rating]),RELATEDTABLE(ratings))
AvgRating = AVERAGE(ratings[Rating])
It is unavailable to sort a slicer by measure. As a workaround, you can use the ‘Hierarchical Filter - xViz’ visual from Marketplace and use ‘AvgRating’ measure as value. And in the ‘Fields’, click the ‘drop down’ button and choose ‘show item with no data’.
Result:
If I misunderstand your thought, please show me your expected output, I am glad to solve the problem for you.
Best Regards,
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.