Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sort Category

Hi Power BI Community,   I have what seems like a trivial request - sort category.   Session is my category. In theory, Session is sorted in ascending order. However, sessions 10, 11, Aysnch are ...
  • v-luwang-msft's avatar
    3 years ago

    HI Anonymous ,

    Pls test the below:

    = Table.AddColumn(#"Changed Type", "ession Order", each if [Session] = "1" then 1 else if [Session] = "2" then 2 else if [Session] = "3" then 3 else if [Session] = "4" then 4 else if [Session] = "5" then 5 else if [Session] = "6" then 6 else if [Session] = "7" then 7 else if [Session] = "8" then 8 else if [Session] = "9" then 9 else if [Session] = "10" then 10 else if [Session] = "11" then 11 else if [Session] = "12" then 12 else 13)

    Output:

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.And if your question still not solved ,pls share your pbix file.

     

     

    Best Regards,
    Lucien