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
LahiruFernando
Frequent Visitor

How to show percentage by category and subcategory separately in a matrix table

Dear All,

I have below concern and please do assit on this. I have a data table similart to tale no 1. which has main category and sub categories under each main category for each month and their respective values.

CategorySubCategoryMonthValue
Aa01-Jan-24100
Ab01-Jan-24200
Ac01-Jan-24100
Ba01-Jan-24350
Bb01-Jan-24250
Aa01-Feb-24250
Ab01-Feb-24150
Ac01-Feb-24200
Ba01-Feb-24350
Bb01-Feb-24150


by using the row data it is very easy to create the table below using matrix table,

CategorySub category01-Jan-2401-Feb-24Total
A 4006001000
 a100250350
 b200150350
 c100200300
B 6005001100
 a350350700
 b250150400
Total 100011002100


but what i want it to generate below table as the final result which when for each subcategory, the percentage should calculate within the main category and sum up to 100% within the main category. where the total percentage of main categories sum up to 100% seperately for each month.

Category01-Jan-2401-Feb-24Total
A 40%55%48%
 a25%42%35%
 b50%25%35%
 c25%33%30%
B 60%45%52%
 a58%70%64%
 b42%30%36%
Total 100%100%100%


much appreciated your solutions towards this.
Thanking in advance.

1 ACCEPTED SOLUTION

You are welcome.  PBI file attached.

Hope this helps.

Ashish_Mathur_0-1714462804883.png

 


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

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1714445732457.png

 


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

@Ashish_Mathur ,

Thank you so much for the response, this helps with the subcategory %. can you help me to show the maincategory level % as below without changing the what i highlighted as correct.
example : what is ticked is correct, need to change the main category A=40%, B=60% for the month of Jan

LahiruFernando_0-1714449056347.png

 

You are welcome.  PBI file attached.

Hope this helps.

Ashish_Mathur_0-1714462804883.png

 


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

@Ashish_Mathur ,
Thank you so much. this works perfrectly.

You are welcome.


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

@Ashish_Mathur ,

Thank you so much for the response, this helps with the subcategory %. can you help me to show the maincategory level % as below without changing the what i highlighted as correct.
example : what is ticked is correct, need to change the main category A=40%, B=60% for the month of Jan

LahiruFernando_0-1714449056347.png

 

Tahreem24
Super User
Super User

@LahiruFernando , You can use the inbuilt functionality of "Percent of column total". Just click "Down arrow "on your value column and choose the below option so you'll get the expected output.

 

 

Tahreem24_0-1714402685664.png

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 ,
Thank you so much for your solution, I have tried this before and it will give me the main category level percentage split correctly sum up to 100%. but what I want is at the same time to calculate the subcategory level % within the category, where the total % within main category of subcategories should sum up to % as well. so then I can see what is the contribution form each sub category to the main category. 

if you will be able to generate, please kindly assist
Thank you

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.