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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have raw data as follows
Then I use power bi and use Matrix to drag the table as follows. However, I want to sort by the following 2 conditions:
1. Sort by year from smallest to largest
2. In each year, revenue by product is sorted from largest to smallest revenue.
I can only sort by 1 condition, I cannot combine both conditions.
This is the result I want
Please help me!
Solved! Go to Solution.
Matrix can only be sorted either by value or by category. In your case, you can sort by the field in the second level of the row hierarchy.
Step 1: In your Matrix, add a field to the row hierarchy (which you will later remove).
Step 2: Change the Matrix to a Table visual.
Step 3: Sort all the columns you wish to sort, and in the order you wish them to be sorted.
Step 4: Delete the field you previously added in Step 1 from the table.
Step 5: Change the Table back to a Matrix visual.
Step 6: Ensure the right fields are back in the Row hierarchy.
This will maintain your multiple sorted fields within your matrix, even when you expand your row hierarchies.
Matrix can only be sorted either by value or by category. In your case, you can sort by the field in the second level of the row hierarchy.