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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
E_K_
Helper III
Helper III

Sort in 2 ways at once one visual single dataset

Hi there

 

I have the below table, made up of fields from 'RiskRegister.

I have a sort column for the ([Source Name] that orders the sources as RCI,Audit Issue,RCSA Action,RCI Action,Audit Action, and Op Event Action from top to bottom. I just need to somehow sort the values from the [Status] column  to read from left to right:  Past Due, Due in < 30 days, and Open, not alphabetically as default.

What do I do? I can't sort 2 different columns within the same dataset by 2 different columns. Using a combined sort order for both didn't work for me.

Below is the final table as displayed in my desktop. The source name is sorted but the statuses are not : 

 

Source NameDue in < 30 DaysOpenPast Due
RCI131
Audit Issue121
RCI Action131
RCI Action151
Audit Action132
Op Event Action153

 

5 REPLIES 5
v-mdharahman
Community Support
Community Support

Hi @E_K_,

Thanks for reaching out to the Microsoft fabric community forum.

You qre right that Power BI visuals like the matrix don't let you directly sort two different columns by two different fields within the same table. However, as @FBergamaschi and others suggested the workaround to create sort helper tables and then link them to your fact table. Kindly go through their responses and check if your issue can be resolved.

 

I would also take a moment to thank @burakkaragoz, @danextian and @FBergamaschi`, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.

Hi @E_K_,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround so that other users can benefit as well.  And if you're still looking for guidance, feel free to give us an update, we’re here for you.

 

Best Regards,

Hammad.

burakkaragoz
Community Champion
Community Champion

Hi @E_K_ ,

 

 

You've got a classic Power BI sorting challenge here. Both responses you received are correct, but let me give you the complete solution.

@FBergamaschi 's approach is the best practice method:

Step 1: Create a Status Sort Table Go to Home → Enter Data and create:

Status               Sort Order
Past Due             1
Due in < 30 days     2  
Open                 3

Step 2: Create Relationship

  • Model view → Drag from Status Sort Table[Status] to your main table[Status]
  • Set as 1:Many relationship

Step 3: Sort the Status Column

  • Data view → Select Status column
  • Column tools → Sort by Column → Select "Sort Order"

Step 4: For Source Name (if you need custom sorting) Create another table:

Source Name          Sort Order
RCI                  1
Audit Issue          2  
RCI Action           3
Audit Action         4
Op Event Action      5

Follow the same relationship and sorting steps.

Alternative: Query Editor Method If you prefer the conditional column approach:

  • Transform Data → Add Column → Conditional Column
  • Create rules for Status sorting (Past Due = 1, etc.)
  • Sort Status by this new column

Both methods work, but the separate table approach is cleaner for maintenance and reusability across multiple reports.


If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.

This response was assisted by AI for translation and formatting purposes.

danextian
Super User
Super User

Hi @E_K_ 

In the query editor create a conditional column that returns a sort values.

danextian_0-1753244675121.png

Use this to custom sort the Status column by

danextian_1-1753244759311.png

Do the same for Source Name if you want a different sort order.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
FBergamaschi
Solution Sage
Solution Sage

Source Name and Status are two different columns, therefore you can sort them by the values of another column

 

For the Status if you do not have already a suitable table, you can create it (insert data in Power BI Desktop)

 

Status                        Order

Past Due                      1
Due in < 30 days         2
Open                           3

 

Connect this table 1 to many to the Fact table, bring the Order in the Fact table trhough a calculated column using the RELATED function and sort Status via the values of Order

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.