Forum Discussion
Ania26
Helper IV
1 year agoSorting by the last column
Hello, CountryValueYear USA 1 2023 France 3 2023 Canada 1 2023 USA 2 2024 France 1 2024 Canada 6 2024 For the data above , I have amtrix table: How ca...
- 1 year ago
Hey there!
You could try creating a Sort Column in Power Query
- Since the matrix does not allow direct sorting by specific columns, create a calculated column:
- In Power Query, add a new column:SortColumn = 'YourTable'[2024] // Ensure this refers to the 2024 column
Sort the Matrix Table Using This Column
- Go to the Fields pane in Power BI.
- Click on the Country column.
- Select Sort by Column → Choose SortColumn.
Ensure Sorting Order
- If the sort is incorrect, adjust sorting in Visual Level Filters:
- Click on the matrix table.
- Under Sorting & Filtering options, select 2024 column → Sort Descending.
- If the sort is incorrect, adjust sorting in Visual Level Filters:
If sorting directly is not working, create a DAX measure to rank countries based on the 2024 values:
Rank2024 = RANKX(ALL('YourTable'), SUM('YourTable'[2024]), , DESC, DENSE)Then, sort the matrix by Rank2024 instead.
Hope this helps!
😁😁
v-echaithra
Community Support
1 year agoHi Ania26 ,
We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.