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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
anshusaketsingh
Frequent Visitor

Dynamic sorting for matrix column headers based on Field Parameter

Hi Experts 

 

So I am using a field parameter as column and want it to sort dynamically based on distinct count of order ids. For eg, I want the below table to sort dynamically with Standard Class on left as it has highest order ids , followed by Second Class, First Class and then Same Day.

 

But it should dynamically change order based on order ids when I switch to Category or any other parameter.

I tried to create a dax to countd distinct ids and rankx to rank the dimensions but it is giving circular error.

Any help will be deeply appreciated.

Added a workbook with case scenerio for reference.

 

Superstore Reference Workbook.pbix

Sample - Superstore.xlsx

 

anshusaketsingh_2-1711020395890.png

 

Dataset Looks like-

anshusaketsingh_0-1711020264477.png

 

 

1 REPLY 1
lbendlin
Super User
Super User

want it to sort dynamically based on distinct count of order ids

That's a great requirement.  Unfortunately columns can only be sorted based on other columns which means the sort order is static.

 

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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