Forum Discussion
Why is my sorting not working?
Hi all,
Im a bit confused why my sorting isnt working - im probably missing something very obvious. This is my data set for my matrix table. Level 2 and also Level 1 order is in my rows, then Type and the amounts are all in my values section. I have done it this way so i can apply conditional formatting to the rows.
I have based Type on the level 1 order so its working for this, but for some reason my level 2 is showing as Net Revenue, then Gross Profit % then Gross Profit. I want the order to be Net Revenue, Gross Profit and then Gross Profit %. Can anyone suggest why this is happening and how to do the sorting so it is in the right order?
Data set below :
| Level 2 | Type | MTD Actual | Level 1 order | |
| Net Revenue | Total | 1,716.7 | 1 | |
| Net Revenue | Apples | 382.2 | 2 | |
| Net Revenue | Pears | 304.6 | 3 | |
| Net Revenue | Bananas | 289.9 | 4 | |
| Net Revenue | Plums | 646.7 | 5 | |
| Net Revenue | Oranges | 93.3 | 6 | |
| Net Revenue | Other | (0.0) | 7 | |
| Gross Profit | Total | 670.2 | 8 | |
| Gross Profit | Apples | 175.7 | 9 | |
| Gross Profit | Pears | 136.8 | 10 | |
| Gross Profit | Bananas | 116.9 | 11 | |
| Gross Profit | Plums | 199.3 | 12 | |
| Gross Profit | Oranges | 41.6 | 13 | |
| Gross Profit | Other | (0.0) | 14 | |
| Gross Profit Margin % | Total | 39.0% | 15 | |
| Gross Profit Margin % | Apples | 46.0% | 16 | |
| Gross Profit Margin % | Pears | 44.9% | 17 | |
| Gross Profit Margin % | Bananas | 40.3% | 18 | |
| Gross Profit Margin % | Plums | 30.8% | 19 | |
| Gross Profit Margin % | Oranges | 44.5% | 20 |
Hi EvaHello ,
Add a column to your model with the sort order for the level 2 so in this case you will have:
Net Revenue - 1
Gross Proft - 2
Gross Profit % - 3
Then use the Sort by column to do the sort of level 2.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column
Hi EvaHello , Thank you for reaching out to the Microsoft Fabric Community Forum.
I reproduced the scenario on my end using sample data and it worked successfully. To help you better understand the implementation, I’ve attached the .pbix file for your reference. Please take a look at it and let me know your observations.
Thank you for being part of the Microsoft Fabric Community!
5 Replies
- MFelixSuper User
Hi EvaHello ,
Add a column to your model with the sort order for the level 2 so in this case you will have:
Net Revenue - 1
Gross Proft - 2
Gross Profit % - 3
Then use the Sort by column to do the sort of level 2.
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column
- v-hashadapuCommunity Support
Hi EvaHello , Thank you for reaching out to the Microsoft Fabric Community Forum.
I reproduced the scenario on my end using sample data and it worked successfully. To help you better understand the implementation, I’ve attached the .pbix file for your reference. Please take a look at it and let me know your observations.
Thank you for being part of the Microsoft Fabric Community!
- v-hashadapuCommunity Support
Hi EvaHello , hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.
- v-hashadapuCommunity Support
Hi EvaHello , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.
- v-hashadapuCommunity Support
Hi EvaHello , Hope you're doing fine. Can you confirm if the problem is solved or still persists? Sharing your details will help others in the community.