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
dpell3
New Member

Sorting Matrix Table Values

Hi everyone, I'm trying to sort the following values to arrange the matrix with the SWITCH function to avail:

 

Sort = SWITCH('Merged Data'[Action], "Market", 1, "Region", 2, "National", 3, "Received", 4)

DGPBI1.JPG

 

 

I'm trying to get the table to look like this:

Market

- No BOM Order Found

- BOM in Draft

- Pending Market Review

- Review Shortage

Region

- Pending Regional Review

- ...

- ...

- ...

National

- ...

Received

- ...

 

Anyone aware of a simpler way to sort rows/columns?

 

Many thanks!

1 ACCEPTED SOLUTION
edhans
Super User
Super User

You would need to create one of two things:

  • Child tables that had your main headings (Market, Region, etc) with a second field with 1, 2, 3, 4, etc in them. Then select your main heading, Modeling tab, sort by column, and pick the second field.
    • repeat for the sub heading (BOM in draft, No BOM order found), etc.
  • or add a column to the main table that has Market, Region ,etc. but for Market, 1 (your sort code) would have to repeat for every occurance of Market, 2 to repeat for region ,etc. 

See this article for a more detailed overview of how to sort by another column rather than just alphabetically.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

1 REPLY 1
edhans
Super User
Super User

You would need to create one of two things:

  • Child tables that had your main headings (Market, Region, etc) with a second field with 1, 2, 3, 4, etc in them. Then select your main heading, Modeling tab, sort by column, and pick the second field.
    • repeat for the sub heading (BOM in draft, No BOM order found), etc.
  • or add a column to the main table that has Market, Region ,etc. but for Market, 1 (your sort code) would have to repeat for every occurance of Market, 2 to repeat for region ,etc. 

See this article for a more detailed overview of how to sort by another column rather than just alphabetically.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.