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

Showing Percent of Category along with relevant Bar length for bar chart by category

Hi - I am trying to create a bar chart with categorical data, and within that category show the break out by a sub-category, but as a percent of the total for the category, but maintaining the bar length.  So something like this.  The length of the bar represents say the total cost, with the sub-categories within the bar the % by sub-category of that cost.  (Note - I did the below in Tableau where I know how to achieve this) 

 

categorical_bar_chart.PNG

 

I I Found the Following Dax Expression which kind of gets me there:  (CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Category]=MAX('Table1'[Category])&&'Table1'[Month]=MAX('Table1'[Month]))))/CALCULATE(SUM(Table1[Value]),FILTER(ALL('Table1'),'Table1'[Month]=MAX('Table1'[Month])))

 

But the problem is that it makes the bar 100% instead of maintaining the length, which can be done out of the box in Power BI anyway.  

 

Any ideas on how I can achieve this?  Thanks! 

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

Sorry for my late reply. would you like to get below one?

You can show the value of % of grand total:

05.PNG

Pbix attached.

Community Support Team _ Dina Ye
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

3 REPLIES 3
v-diye-msft
Community Support
Community Support

HI @Anonymous 

 

 

you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive or dropbox and share the link to the file. Please do not forget to describe the expected results based on this sample data.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @Anonymous 

 

Sorry for my late reply. would you like to get below one?

You can show the value of % of grand total:

05.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

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.