Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.