This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi All,
how can we achieve below requirement?
there is a metric slicer, if i choose 'AVERAGE' the it should sort Average measure by ASC order, elseif i choose 'DISMISSALS' then it should sort Dismissals measure by DESC order.
i am not able to achieve the sorting requirement
Data:
Batsman Average Dismissals
| Virat Kohli | 100 | 5 |
| Kedar Jadhav | 62 | 1 |
| Rohit Sharma | 51.9 | 10 |
| Shikhar Dhawan | 34.4 | 12 |
| MS Dhoni | 24.77 | 9 |
Chart:
Thanks,
Raj
Solved! Go to Solution.
Hi @Anonymous ,
First create a slicer table as below:
Then create 2 measures as below:
Measure =
SWITCH(SELECTEDVALUE('Table (2)'[Slicer]),"Average",MAX('Table'[Average ]),"Dismissals",MAX('Table'[Dismissals]),BLANK())Measure 2 =
SWITCH(SELECTEDVALUE('Table (2)'[Slicer]),"Average" ,
RANKX(ALLSELECTED('Table'),'Table'[Measure],,ASC,Dense),
"Dismissals",
RANKX(ALLSELECTED('Table'),'Table'[Measure],,DESC,Dense))
And you will see:(make measure 2 as a tooltip field)
For the related .pbix file,pls see attached.
No Amit, using those 3 dots i cannot sort the way i need.
if i choose 'AVERAGE' the it should sort common measure(Measure) by ASC order, elseif i choose 'DISMISSALS' then it should sort common measure(Measure) by DESC order
Hi @Anonymous ,
First create a slicer table as below:
Then create 2 measures as below:
Measure =
SWITCH(SELECTEDVALUE('Table (2)'[Slicer]),"Average",MAX('Table'[Average ]),"Dismissals",MAX('Table'[Dismissals]),BLANK())Measure 2 =
SWITCH(SELECTEDVALUE('Table (2)'[Slicer]),"Average" ,
RANKX(ALLSELECTED('Table'),'Table'[Measure],,ASC,Dense),
"Dismissals",
RANKX(ALLSELECTED('Table'),'Table'[Measure],,DESC,Dense))
And you will see:(make measure 2 as a tooltip field)
For the related .pbix file,pls see attached.
@Anonymous - I believe that you would need a disconnected table and a single measure that switches between the average and dismissals based upon the slicer selection. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...
Thanks Greg.
Infact i have created a disconnected table and a single measure that switches between the average and dismissals based upon the slicer selection. but i am stuck with the sorting - Average should sort by Asc and Dismissals should sort by Desc.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 22 | |
| 22 |