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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
VladyOselsky
Frequent Visitor

Need help setting up Matrix

Hello,

 

I'm not sure if there is functionality in defaul visual to achive the following. I have setup measures to Calculate Sales Total, Sales Quantity and other related information. After that I added column to my matrix that breaks it into different categories.

I want to be able to group all categories under a each measures instead of grouping measures under each category. Currently my matrix looks like example 1. But I want to convert it to look like example 2.

I have tried to use Options -> Switch Values to Rows which looks better but it makes it harder to see trendes over months for each section as it produces extra rows.

I really don't want to setup measures for each category in the following matter SalesTotalAll, SalesTotalGear, SalesTotalClothing, SalesTotalMisc etc. 

 

VladyOselsky_0-1689626934095.png

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @VladyOselsky 

According to your description, you want to convert the Matrix visual , do you mean you want to make this:

vyueyunzhmsft_0-1689735789192.png

If this , you can create a dimension table 'table 2' like this:

vyueyunzhmsft_1-1689735812040.png

 

Then we can create a measure based on youe second measure :

Measure = 
var _type =  MAX('Table 2'[Column1])
return
IF(_type = "Sales Total" ,  SUMX( VALUES('Table'[Categories]) , [Sales Total]) , IF( _type="Sales Quanity" , SUMX( VALUES('Table'[Categories]) , [Sales Quantity])))

 

The result is as follows:

vyueyunzhmsft_2-1689735861560.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @VladyOselsky 

According to your description, you want to convert the Matrix visual , do you mean you want to make this:

vyueyunzhmsft_0-1689735789192.png

If this , you can create a dimension table 'table 2' like this:

vyueyunzhmsft_1-1689735812040.png

 

Then we can create a measure based on youe second measure :

Measure = 
var _type =  MAX('Table 2'[Column1])
return
IF(_type = "Sales Total" ,  SUMX( VALUES('Table'[Categories]) , [Sales Total]) , IF( _type="Sales Quanity" , SUMX( VALUES('Table'[Categories]) , [Sales Quantity])))

 

The result is as follows:

vyueyunzhmsft_2-1689735861560.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ashish_Mathur
Super User
Super User

Hi,

As far as i know, this is not possible to do.  One will have to use calculations Groups in the Tabular Editor.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.