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
Anonymous
Not applicable

Sort Values in a Matrix

Hello,I'm surprised I couldn't already find an answer to this question. I am working with this matrix table: 

 

Capture.PNG

The values shown are % of the column total for each category. I want to sort these values by the most recent month. As you can see from the image I'm able to sort the TOTAL column, but how can you sort by one of the other columns? 

 

As a side note, it's not important to me to keep the row/column totals. 

 

Thanks for any help!

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi efliberty,

 

In your senario, I would recommend you to use a table chart and create a calculate column to achieve the total values every category using DAX like this pattern:

 

Total =
CALCULATE ( SUM ( Table[Values] ), ALLEXCEPT ( Table, Table[Category] ) )

Then you can click date column to sort other columns.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy, 

 

Thank you for your reply! I'm not sure I understand the logic behind that formula (I'm still learning DAX). In this example I'm looking at survey data, collected monthly. Respondents are asked to describe a product and I want to know what % of responses pertain to each product, each month. So the rows are the products and the value of the table is the count of responses, show as a % of column total. Can you explain why you would use SUM and ALLEXCEPT for this? 

 

As a side note, the picture I provided is a summarized version of the table with the data grouped into a handful of products. The actual table has about 300 products. Would I have to make a custom column for each? Or am I making a custom column for each month? 

 

Thank you for your help!

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.