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

How to show child/parent totals in matrix visualization

I have a set of sales data by customer. However, some customers have the same parent company. I would like to show in a matrix vizualization the total sales by customer, and include the total sales by parent. Below is what the desired output would look like:

 

Customer Parent Customer Total Parent Total
Customer1 Parent1 $150 $175
Customer2 Parent1 $25 $175
Customer3 Parent2 $100 $200
Customer4 Parent2 $50 $200
Customer5 Parent2 $50 $200

 

I've looked at various SUMIF-style solutions but none seem to give me the desired results. Is this possible, and if so what would the DAX be to calculate this?

 

Much appreciated.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@StevenHiatt , based on what I got, a measure for

Parent Total =

calculate([Customer Total], filter( allselected(Table), Table[Customer] = max(Table[Customer])))

View solution in original post

2 REPLIES 2
StevenHiatt
Frequent Visitor

Thanks so much. Slight change to get the right answer:

calculate([Customer Total], filter( allselected(Table), Table[Parent] = max(Table[Parent])))

but that got me pointed in the right direction.

 

Just curious what the MAX is doing in the formula? Would MIN or AVG, etc work essentially the same?

amitchandak
Super User
Super User

@StevenHiatt , based on what I got, a measure for

Parent Total =

calculate([Customer Total], filter( allselected(Table), Table[Customer] = max(Table[Customer])))

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.