This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi everyone,
I have a matrix table with a 4-level hierarchy (so four columns in the 'Rows' section): Customer name and Date.
The first column is Customer name which is sorted alphabetically ascending.
The other 3 columns I need sorted descending.
So the desired sort order would be like this:
| - Customer A |
| - A3 |
| 01-03-2024 |
| 01-12-2023 |
| 01-06-2023 |
| 01-10-2022 |
| + A2 |
| - A1 |
| 01-06-2019 |
| 01-04-2019 |
| 01-03-2019 |
| 01-10-2018 |
| + Customer B |
| + Customer C |
How can this be achieved?
Any help would be greatly appreciated.
Thanks!
Solved! Go to Solution.
Hi @GKJARC
You need a "sort column" for every hierarchy level in your table with the needed order and sort the columns from the data view:
For a date column, you should use a date table create the column with the numeric date value and multiply it to (-1):
Result :
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
@Ritaf1983 This works, thank you very much!
Be aware though that Number.From([Date]) doesn't always work well with datetime. For datetime I ended up using this SQL to get an inverted number from date: DATEDIFF(MINUTE, EE.ENTRYDATE, '2099-12-31T23:59:59') AS DateInvertedSorting
Hi @GKJARC
You need a "sort column" for every hierarchy level in your table with the needed order and sort the columns from the data view:
For a date column, you should use a date table create the column with the numeric date value and multiply it to (-1):
Result :
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 25 | |
| 23 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 27 | |
| 23 | |
| 19 |