Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CWitts
Frequent Visitor

Sorting multiple columns

I have a direct query from Oracle database which is correctly sorted on import.  When I go to transform data, I can set the sort I want (four different column) and the result is correct.  However, when I create a table the sort is being completely ignored, so the end user is not going to see the information as I need them to. 

Does anyone have any ideas on why this is and how I can resolve it?

4 REPLIES 4
Ttaylor9870
Helper III
Helper III

Hi @CWitts,

 

You could maybe make a calculated column using SWITCH to assign e.g ABC = 1 then sort whatever column you want based on the results of that swtich statement. You can sort your column by clicking on model view then finding the column you'd like sorted and and assign the newly created SWTITCH statment in this field...

 

Ttaylor9870_0-1677169754853.png

Many Thanks,

 

Taylor 😎

 

Ttaylor9870
Helper III
Helper III

What are the 4 columns and what order do you want them ordered? I have solved a similar issue before

I want to sort the following:  Customer number, Item, numerical number of type of item (1, 2, 3) and sequence number

CWitts
Frequent Visitor

Further clarification:  I have a large data set and for each "customer" there are multiple items that are listed and against each item, sub groups. EG

Row number Customer  Item        Numerical number of type    seq
001 ABC       Fruit      1                           001
002 ABC       Fruit      1                           002
003 ABC       Veg        1                           001
004 ABC       Veg        2                           001
005 XYZ       Fruit      3                           001   
006 XYZ       Fruit      1                           001
007 XYZ       Fruit      1                           002

 

I need to sort this so all ABC rows are together with Fruit above Veg, type 1 above type 2, etc.  So the above would resort wo row number 005 would appear at the bottom.

 

Hope that helps.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.