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
Jeff2Jets
Helper I
Helper I

Counting children for a parent when the children reside in a different table.

I am very new to Power BI, but I do have a programming background. I am trying to determine how to count the number of children for a parent, when the parent and children are in different tables.

 

The parent table contains:

  • Customer ID
  • Customer Name

The children table contains:

  • Customer ID
  • Product ID
  • Product Name

The two tables are related by the Customer ID. I would like to display the # of children in a visualization of type 'Table', preferably with a new column that contains the # of children.

 

Any help would be greatly appreciated!

 

 

1 ACCEPTED SOLUTION

Thank you so much for your help! I hope you have an awesome day.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Assuming the data model looks like this:

OfTheHair_0-1659527349276.png

 

And this is the result you want?

OfTheHair_1-1659527403912.png

 

In the Visualization pane to the right, add the [Parent table]'Customer Name' and [Child table]'Product Name' (or 'Product ID', either works). Then click the down button for 'Product Name' and select either 'Count' or 'Distinct Count'.

 

OfTheHair_2-1659527638597.png

 

 

 

Thank you so much for your help! I hope you have an awesome day.

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.

Top Solution Authors