cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rax99 Member
Member

Sorting on a calculated column containing a switch statement

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

 

switch.JPG

 

 

 

 

 

 

 

 

Ends up looking like this on a sorted line chart;

 

axis.JPG

 

 

 

 

 

 

 

 

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? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-cherch-msft Super Contributor
Super Contributor

Re: Sorting on a calculated column containing a switch statement

Hi @rax99

 

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)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
v-cherch-msft Super Contributor
Super Contributor

Re: Sorting on a calculated column containing a switch statement

Hi @rax99

 

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)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 5 members 3,201 guests
Please welcome our newest community members: