Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Sorting on a calculated column containing a switch statement

I have the following bins/groups created for my data using this switch statement;

 

 

 

 

 

 

 

 

 

Ends up looking like this on a sorted line chart;

 

 

 

 

 

 

 

 

 

As you can see the sorting is all over the place, I believe its now trying to sort on text values. How can I sort in asc order? 

 

  • Hi Anonymous

     

    You may try to add an order column as below. Then drag it to 'Tooltips' to sort the chart.

    Order = PATHITEM( SUBSTITUTE(Table1[Text],"-","|"),1,INTEGER)

     

    Regards,

    Cherie

1 Reply

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi Anonymous

     

    You may try to add an order column as below. Then drag it to 'Tooltips' to sort the chart.

    Order = PATHITEM( SUBSTITUTE(Table1[Text],"-","|"),1,INTEGER)

     

    Regards,

    Cherie