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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
dsi
Frequent Visitor

Sort Matrix Column Headers by dynamic in slicer context

Hello all,

 

unforgetly i'll need help with my visual. Does anybody have a solution to sort header dynamic in filter context?
I would like to sort it by the average value based on my Year/month filters.
Expected sorting : A-C-G-B-F-E-D

dsi_0-1707324040277.png

 

4 REPLIES 4
Anonymous
Not applicable

Hi @dsi 

 

Please try this:

I create a set of sample data:

vzhengdxumsft_0-1707361677211.png

Then copy the column which you need to sort and click Enter Data:

vzhengdxumsft_1-1707361770292.png

Then Transform data > Merge Queries:

vzhengdxumsft_2-1707361837613.pngvzhengdxumsft_3-1707361862708.png

Close&Apply,

select the column and click Sort by column, select the sort column.

vzhengdxumsft_4-1707361926125.png

The result is as follow:

vzhengdxumsft_5-1707362009567.png

 

Best Regards,

Zhengdong Xu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

dsi
Frequent Visitor

Hello,

thank you for replying, but this solution was well known. 

Daniel29195
Super User
Super User

@dsi 

you cant dynamically change the sorting order of the columns base on a measure in a matrix . 

 

 

but what you can do , is set a static order for the column you are using in the column setion for the matrix.

 

you can sort base on your knowledge of your data .

lets say, you know that almost always A is the highest, then you give it an index of 1 . etc...

( you create a sorting column in power query) 

 

 

 

best regards 

I had feared that. I think it will almost being that. 

Calculated table with Averages of each Periode and Country. Periode and Country are the filters for this view.  

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors