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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 33 | |
| 29 | |
| 27 |
| User | Count |
|---|---|
| 134 | |
| 104 | |
| 63 | |
| 60 | |
| 55 |