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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jamoroso
Helper I
Helper I

Sorting within a Matrix visual

Hi,

I am trying to create and sort a matrix style visual, but cannot get it to work. I need to recreate this in Power BI in the order in this visual. There is sample data below. Thank you.  -Janet

jamoroso_0-1668626450597.png

AccountDetailRange or TermCurrentDividendRateAPYProposedDividendRateAPYChangeSort Order
K - CashQ Rate 1.00%1.00%-1
K - CashNon Q Rate 1.00%1.00%-2
K - SaverQ Rate 1.00%1.00%-3
K - SaverNon Q Rate 1.00%1.00%-4
Share Draft  1.00%1.00%-5
Share Savings & Clubs  1.00%1.00%-6
Money Market $5,000 - $9,9991.00%1.00%-7
Money Market $10,000 - $49,9991.00%1.00%-8
Money Market $50,000 - $99,9991.00%1.00%-9
Retirement Share Accounts $50,000 - $99,9991.00%1.00%-10
Retirement Share Accounts $100,000 -$249,9991.00%1.00%-11
Retirement Share Accounts $250,000 -$499,9991.00%1.00%-12
Health Savings Account (H.S.A.) $0 - $9991.00%1.00%-13
Health Savings Account (H.S.A.) $1,000 - $4,9991.00%1.00%-14
Health Savings Account (H.S.A.) $5,000 +1.00%1.00%-15
Certificates of Deposit/IRA Certificates 3 Mo.1.00%1.00%-16
Certificates of Deposit/IRA Certificates 6 Mo.1.00%1.00%-17
Certificates of Deposit/IRA Certificates 12 Mo.1.00%1.00%-18
Certificates of Deposit/IRA Certificates 18 Mo.1.00%1.00%-19
Business AccountsBasic Business Checking 1.00%1.00%-20
Business AccountsPremium Business Checking$0 - $24,9991.00%1.00%-21
Business AccountsPremium Business Checking$25,000 - $49,9991.00%1.00%-22
Business AccountsPremium Business Checking$50,000 - $99,9991.00%1.00%-23
Business AccountsRT Business Checking$1,500 - $2,9991.00%1.00%-24
Business AccountsRT Business Checking$3,000 - $9,9991.00%1.00%-25
Business AccountsBusiness Savings 1.00%1.00%-26
Specials 10 Month Cert Special1.00%1.00%-27
Specials 15 Month Cert Special1.00%1.00%-28

 

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @jamoroso 

 

I created a matrix like below based on your sample data. Not completely consistent with your expected output but the sorting orders are as expected. Can this meet your need? 

vjingzhang_0-1668669867922.png

 

I have attached the sample pbix file at bottom. You can see detailed steps in it. 

 

Main steps include two parts: 

1. Use Group by feature in Power Query Editor to add three sorting columns for "Account", "Detail" and "Range or Term" columns individually based on the existing "Sort order" column. Grouping or summarizing rows - Power Query

2. Apply the changes to Power BI Desktop. Then sort "Account" column by "Account Sort", sort "Detail" by "Detail Sort" and sort "Range or Term" by "RangeTerm Sort". Sort one column by another column in Power BI - Power BI

 

After you add columns to the matrix visual, sort data by "Account" column ascendingly. 

 

Hope this helps. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @jamoroso 

 

I created a matrix like below based on your sample data. Not completely consistent with your expected output but the sorting orders are as expected. Can this meet your need? 

vjingzhang_0-1668669867922.png

 

I have attached the sample pbix file at bottom. You can see detailed steps in it. 

 

Main steps include two parts: 

1. Use Group by feature in Power Query Editor to add three sorting columns for "Account", "Detail" and "Range or Term" columns individually based on the existing "Sort order" column. Grouping or summarizing rows - Power Query

2. Apply the changes to Power BI Desktop. Then sort "Account" column by "Account Sort", sort "Detail" by "Detail Sort" and sort "Range or Term" by "RangeTerm Sort". Sort one column by another column in Power BI - Power BI

 

After you add columns to the matrix visual, sort data by "Account" column ascendingly. 

 

Hope this helps. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

Hi @v-jingzhang,

 

I thought this worked, but just realized 1 of the sections is not in the right order.  The ranges in the Premium Business Checking are not right. They should be

  1. $0 - $24,999
  2. $25,000 - $49,999
  3. $50,000 - $99,999

They are showing as:

jamoroso_0-1669755481693.png

I have additional data in the live spreadsheet for other sections with this same issue. I assume it has to do with the same range being in multiple Account/Detail combinations. I am not sure how to solve this. Are you able to help me with this?

 

Thanks, Janet 

 

amitchandak
Super User
Super User

@jamoroso , You need to have a sort column for account and details

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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