Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I have a matrix and I want the user to have the capibility to sort by columns (I have months on the column to keep it dynamic), which, I know is not the default funcionality. Is there a workaround to get the sorting funcionality by column and the months remain dynamic.
Regards,
Yashwant Mishra
Solved! Go to Solution.
Hi @yashwant101, it's all about ranking (Sort one column by another column in Power BI - Power BI | Microsoft Learn).
In the example below months are ranked from the latest to the earliest month:
So when showing months on a visual in ascending order (default for columns in matrix), you'll get the latest month first:
I hope it helps!
Hi @yashwant101, as of my knowledge you can't dynamically sort by columns.
The data source column you use in "Columns" field of matrix visual is sorted automatically in ascending order (you can invert the order or define it as you wish using "Sort by column" functionaly (see details). However, it can't be dynamic.
I'm wondering what use case do you have? Why your user might need to sort months dynamically?
Hi @Sergii24 ,
Maybe my description was not very clear. PFB the complete description:
I have a matrix where I have recent 4 months, which change dynamically based on data.
Now the fucionality I am wondering about is sort based on specific months i.e if I click on any one month the matrix should sorted based on that month (like we have click on column and sort funcionality in table visual). Here I am not able to use table visual because I have changing latest 4 months.
Regards,
Yashwant
I believe the only similar thing you can do is sort the matrix by your KPI in descending order, so your "outlets" will be sorted accordingly. However, such sorting will happen at row subtotal level.
For example, if "Bangaluru" have max number of outlests within all 4 selected months, it will remain at the first position even if you click on some specific month, to which another outlet has a higher value (example Apr-24 from your example: Bangaluru will stay the first one instead of Mumbai).
To sort this visual by Apr-24 values only and get Mumbai at the first row, the visual should be filtered in a way that gives you only one column for KPI: Apr-24.
I hope it helps!
Hi @Sergii24 ,
Thanks for your response. Is there any way that the grid is sroted by default on leatest month descending then the 2nd latest and so on?
Hi @yashwant101, it's all about ranking (Sort one column by another column in Power BI - Power BI | Microsoft Learn).
In the example below months are ranked from the latest to the earliest month:
So when showing months on a visual in ascending order (default for columns in matrix), you'll get the latest month first:
I hope it helps!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!