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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
leekarensl
Helper II
Helper II

Sorting by Spend column in a dynamic metric setting

Hello, 

 

One of the request faced by my stakeholder is wanting the ability to select only certain columns to show in a table visual. To accomodate this need, I have used DAX to create a metrics table (called Metrics_Slicer in the attached), and then used a measure (called Selected Metric Value in the attached) to allow them to select what they want to see on the visual. 

 

However, the stakeholder also require it to be sorted by spend (see the Original tab). I cannot seem to do this but it is an essential requirement. Is there a way around this please? 

 

Link to the file is here: https://drive.google.com/file/d/1k7ywA75Xc2gE48VOgWWT_-yl05bjt6AT/view?usp=sharing

 

Thanks in advance.

1 ACCEPTED SOLUTION
Thejeswar
Super User
Super User

HI @leekarensl ,

I don't think you can sort your columns individually using this approach. Seeing your report, I understood that the sort happens based on the total column. One more thing is you are keeping it as text, so the sort also is going to happen based on character. i.e. 85 will be greater than 600.

 

Instead you can go ahead with the approach of using Field Parameters for this.

Thejeswar_0-1739974810614.png

 

Refer the Page 1 in the file attached here

Regards,

View solution in original post

4 REPLIES 4
Thejeswar
Super User
Super User

HI @leekarensl ,

I don't think you can sort your columns individually using this approach. Seeing your report, I understood that the sort happens based on the total column. One more thing is you are keeping it as text, so the sort also is going to happen based on character. i.e. 85 will be greater than 600.

 

Instead you can go ahead with the approach of using Field Parameters for this.

Thejeswar_0-1739974810614.png

 

Refer the Page 1 in the file attached here

Regards,

I got it, thanks, it works perfectly! Will mark as Accept as solution

Hi Thejeswar, this works but I can't seem to replicate your table MeasureSelector using NAMEOF. How is this done please. Thanks.

BhavinVyas3003
Super User
Super User

Sorting by a measure won't be allowed, but you can use RANKX with ALLSELECTED() to create a ranking measure and than try to sort the table based on this rank measure.


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors