Forum

Notifications
Clear all

How to compare sales for two groups families with one kid and families with two kids

4 Posts
2 Users
0 Reactions
135 Views
(@jycccwjc)
Posts: 64
Estimable Member
Topic starter
 

Mynda,

 

I have a sales table with row index such as 1, 2, 3, 3, 4, 5, 5, 6, 7, 8,, 9,10, 11, 11, 12, 12, 13, 14, 15..... (please see the attachment)

Each number denotes a child. The duplicates mean families with two kids while non-duplicates mean families with one kid. 

How can I group them with Power Query? Or How can I use Pivot Table to group sales for families with one child and families with two kids? What is the best way to do it?

 

Thanks!

 

Jim

 
Posted : 11/10/2019 5:07 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Jim,

You can do this easily with a PivotTable. Put the 'Kids' field in both the Rows and Values area of the PivotTable. Set the field in the Values area to Count instead of Sum.

If you want to filter just those with 2 or more kids then you can also do so in the PivotTable. Similarly you could just sort the data, however you weren't clear on how you wanted the end result to look.

Mynda

 
Posted : 11/10/2019 8:39 pm
(@jycccwjc)
Posts: 64
Estimable Member
Topic starter
 

Mynda,

Thanks for your help. It works. How can I further group them into two groups (1 kid families & two kids families) with their respective revenues and their respective number of kids? Please see the attachment for clarification. 

 

Jim

 
Posted : 12/10/2019 12:27 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Jim,

You need to add a helper column to the source data that classifies the kids into 1 or 2 kid families. See attached.

Mynda

 
Posted : 12/10/2019 7:35 pm
Share: