Forum Discussion
dynamic sort by measure filter
- 5 years ago
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.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
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/ba-p/279563
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.