This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I am trying to sort the column order of a matrix. I created a helper column to use as the sort order. But when I click the field for the columns in the matrix and click sort by the helper column I get an error message
Solved! Go to Solution.
Hi @TomSinAA ,
you could try this code:-
StateSort = SWITCH(
TMSShipmentDetail[State],
"Awaiting", "1",
"Tendered", "2",
"Confirmed", "3",
"Pick Ready", "4",
"Intransit", "5",
"Delivery Ready", "6",
"Received", "7",
"0" // Default value in case none of the above conditions are met
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @TomSinAA ,
Could you please share the code that you have written for sorting?
And please provide some sample data with the expected output it help us to give you a more specific answer
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Samarth_18 ,
I created a new column in my table using this formula:
Hi @TomSinAA ,
you could try this code:-
StateSort = SWITCH(
TMSShipmentDetail[State],
"Awaiting", "1",
"Tendered", "2",
"Confirmed", "3",
"Pick Ready", "4",
"Intransit", "5",
"Delivery Ready", "6",
"Received", "7",
"0" // Default value in case none of the above conditions are met
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Check out the April 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 |
|---|---|
| 37 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |