cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jjr333 Regular Visitor
Regular Visitor

Sort alphanumeric column by an numeric column

Hi,

I have a datatable with air pollution readings.

8-4-2019 17-35-40.png

"Wind Dir" is derived from the column "Dirección" (which contains the direction in degrees) by using a "bucket table" / lookup table.

Wind Dir = IF (ISBLANK(factSanSeb[Dirección]);BLANK();
                CALCULATE(  
                            VALUES(WindDirection[Direction]); 
                            FILTER(WindDirection; factSanSeb[Dirección] >= WindDirection[Low] && factSanSeb[Dirección] < WindDirection[Hi])
                        ) )


I have added "WindDirOrder" column (N = 1, NE = 2, E = 3, etc using an unrelated lookup table) to be able to sort column "Wind Dir", which does not seem to work in the bar charts and radar chart.

8-4-2019 17-57-58.png

 

Any suggestions? Cheers, Julian

 

8-4-2019 18-00-49.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jjr333 Regular Visitor
Regular Visitor

Re: Sort alphanumeric column by an numeric column

Hi @v-shex-msft ,

Finally got it to work.

My problem was the added Calculated column X (with the sort order) depended on another Calculated column Y which I wanted to sort by X.

Cheers, Julian

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Sort alphanumeric column by an numeric column

Hey,

 

I guess this is what you are looking for: https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column#sort-using-the-sort-by-column-butto...

 

Please be have a look for the section "Sort using the Sort by Column button" on the above mentioned site. You have to order the columns in the table that you are using in your visuals.

 

Regards,

Tom

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
I accept Kudos :-), If you find my post helpful.

Proud to be a Datanaut!
jjr333 Regular Visitor
Regular Visitor

Re: Sort alphanumeric column by an numeric column

Guten Abend Tom,

I keep getting a message "Sorting on a different column: This column cannot be sorted by a column which has already (direct or indirect) been sorted by this column."

My sort by column is a calculated column. Not sure if this is important.

Cheers, Julian

 

8-4-2019 19-41-04.png

Community Support Team
Community Support Team

Re: Sort alphanumeric column by an numeric column

HI @jjr333 ,

You can create a calculate table to achieve this, please refer to following blog to know more about this:

Custom Sorting in Power BI

Please understand that this link is provided with no warranties or guarantees of content changes, and confers no rights.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
jjr333 Regular Visitor
Regular Visitor

Re: Sort alphanumeric column by an numeric column

Hi  

 

 

 

 

 

Community Support Team
Community Support Team

Re: Sort alphanumeric column by an numeric column

HI @jjr333 ,

You need to extract category value from fact table and add index field, then configure 'sort by column' feature on new table category fields and create relationship.
After these steps, You can use custom sort table fields to replace original table column fields.

BTW, I don't think it is possible to custom direction axis for radar chart.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
jjr333 Regular Visitor
Regular Visitor

Re: Sort alphanumeric column by an numeric column

Hi @v-shex-msft ,

Finally got it to work.

My problem was the added Calculated column X (with the sort order) depended on another Calculated column Y which I wanted to sort by X.

Cheers, Julian

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)