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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bideveloper555
Helper IV
Helper IV

Power bi Bar chart group on 2 categories(parent and child)

hi

below is my sample data set, am trying to do a chart which will display child total and child associated parent toal.

in below example: john value = 100 but john is associated to US and total for US value is 300. so i want to display john ,100,300 in a chart.

 

i created measure by country but it doesnt work.

bideveloper555_0-1611844034982.png

Thanks

In advance

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @bideveloper555 

 

You may try the following measure to see if it helps.

Result =
CALCULATE (
    SUM ( 'Sales table'[Value] ),
    ALLEXCEPT ( 'Country Table', 'Country Table'[Name] )
)

 

Best Regard

Allan

 

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

bideveloper555
Helper IV
Helper IV

Hi

thanks for measure and it is working

but sample i sent is coming from 3 different table.

below is real snippy.

Measure i used as you mentioned but i was expecting john,us,90,290 and rob,us,200,290 but still am getting 90,200 as country total(measure)

as am trying to compare his total vs country table

bideveloper555_0-1611860138036.png

 

 

amitchandak
Super User
Super User

@bideveloper555 , Create a new measure like

 

measure =
var _max = calculate(Max(Table[Country]), filter(Table, Table[name] = max(Table[Name])))
return
calculate(sum(Table[value]), filter(allselected(Table), Table[country] =_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.