Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Field Parameters and Sorting based on measure

Hi, 
I am using Field parameters in a drop down and the chart to change accordingly to the dropdown. The chart is a ranking chart(Clustered bar chart) and I want to sort the chart based on the measure selected from the field parameters in descending order. Every time I choose a different value in dropdown my sort will be reset as it as different measure. Is there a work around for this?. Eg. write a new measure to always sort by the selected measure in descending order and use it in the chart.

 

PS, I do not want to deviate from field parameters and use another alternatives to change the chart dynamically with the dropdown selection.

6 REPLIES 6
RicoZhou2
Resolver I
Resolver I

Hi @Anonymous ,

 

Did you create a dynamic Xaxis which is filtered by slicer? As far as I know, if you sort the visual by column in X aixs, Power BI will change the sort dynamiclly.

Here I create a sample.

RicoZhou2_0-1660121571779.png

Measure:

Measure = 
SWITCH(SELECTEDVALUE('Combine Table'[Category]),
"Region",CALCULATE(SUM(Data[Value]),USERELATIONSHIP(Data[Region],Region[Region])),
"Year",CALCULATE(SUM(Data[Value]),USERELATIONSHIP(Data[Year],'Year'[Year])))

Result is as below.

RicoZhou2_1-1660121585936.png

RicoZhou2_2-1660121600020.png

Best Regards.

Anonymous
Not applicable

Hi @RicoZhou2 ,

My slicer has various measures(field parameters) used in the chart, not the columns and I am the measures for the X-axis of a clustered bar chart. I see that your solution is using column to sort not the measures.

amitchandak
Super User
Super User

@Anonymous , Once I sort it on a measure it always remains in that, even when I change that

 

amitchandak_2-1659933281904.png

 

 

amitchandak_0-1659933233951.png

 

amitchandak_1-1659933252133.png

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
amitchandak
Super User
Super User

@Anonymous , Once I sort it on a measure it always remains in that, even when I change that

 

amitchandak_2-1659933281904.png

 

 

amitchandak_0-1659933233951.png

 

amitchandak_1-1659933252133.png

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak , 

Not sure what was done wrong in my case, I am unable to sort by the measure. each time I select another measure, the sorting for the Y-axis is being reset.2.png1.pngI found a similar question here, https://community.powerbi.com/t5/Desktop/Sort-Visual-on-Field-Parameter/m-p/2520955

I have the same issue.

Whenever I select something in the slicer, the sorting is off and I have to set it once again.

 

Did you find any solution for that?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.