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

Creating a Bar Graph with Main Groups and Their Sub Groups

Hi all,

 

I need to calculate total sales figures for each main sales group. One main sales group has three sub groups within it. I need to show each sub groups numbers as well as the main group's total within one bar chart. 

 

Is this possible?

 

Here is a data sample. In theory, the bar graph should show Group 3 with the most sales (1260) with subgroup 3.3 in second, etc.

 

I have an issue when grouping the groups and subgroups, the graph looks messy.

 

Group     Sales

1             100

2             200

3             300

3.1          310 <-- subgroup

3.2          320 <-- subgroup

3.3          330 <-- subgroup

 

Thank you

1 ACCEPTED SOLUTION

Hi @Bridgewater,

If your problem is answered appropriately, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Best Regards,
Angelia

View solution in original post

4 REPLIES 4
v-huizhn-msft
Employee
Employee

Hi @Bridgewater,

I create the sample table in my Power Bi desktop, and get expected result, please review the following steps.

1. Create a new calculated column to display the Gruop, the original group shows the sub-group.

Group = LEFT(Table6[Sub-Group],1)

1.PNG

2. Create a Stacked column chart, select the Group as Axis, the sub-group as Legend, Sales as value. You will get the following result.

5.PNG
Best Regards,
Angelia

 @v-huizhn-msft Thank you so much for that help! 

 

Separating the Main Groups and Sub Groups into different colums helped.

 

One more question. Is it possible to do what you did, but also have the subgroups as their own bar? Below is what I'm trying to acheive ultimately. This was done in excel and transfered to a word doc but it is way too time consuming, hence why I'm trying to use PBI for this. In this example, the dollar numbers aren't necessarily important, only that Group 2 is the combined value of Sub Group 2.1, 2.2, and 2.3. Those subgroups also have their own bar.

 

Thank you again

2017-10-04.png

Hi @Bridgewater,

Yes, you can create a clustered bar chart and select the sub-group as X-axis, the sales as value, please see more details in the screenshot below.

10.PNG

Best Regards,
Angelia

Hi @Bridgewater,

If your problem is answered appropriately, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Best Regards,
Angelia

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.