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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
EaglesTony
Post Prodigy
Post Prodigy

What is the best way to group by

I have a table as follows:

 

Parent ID   Child ID   Child Status  Child Points

1                1              Open            2

1                2              Open            1

1                5              Closed          5

2                8              Dev               null

2                3              Review          1

 

I need this table in tact, but I need a new table as follows (I am eventually a group by):

 

Parent ID  # of Children  # of Child Points

1                 3                  8

2                 2                  1

1 ACCEPTED SOLUTION

I think I may have figured it out, I had to:

 

1) Duplicate the table (since I need to original details)

2) On the Duplicated table use the Group By with multiple conditions

 

View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @EaglesTony ,

 

If you're using Power BI, then you may not need to physically create the second table (depending on your requirements).

The second table can be visualised based on the first table with the following measures:

 

// If [Child ID] is always unique per [Parent ID]
noofChildren = COUNTROWS(Table1)

// If [Child ID] is NOT always unique per [Parent ID]
noofUniqueChildren = DISTINCTCOUNT(Table1[Child ID])

noofChildPoints = SUM(Table1[Child Points])

 

Use these measures along with your [Parent ID] column in a table/matrix visual and it will output your second table.

 

Pete

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




HotChilli
Community Champion
Community Champion

Yes, use the 'Group By'.  What are you having difficulty with?

I think I may have figured it out, I had to:

 

1) Duplicate the table (since I need to original details)

2) On the Duplicated table use the Group By with multiple conditions

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.