cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmsm
Helper I
Helper I

Agregate rows by family type

Hello all. 

 

I have the following problem: My dataset has a bunch of rows that correspond to each product ordered by a customer, and each product has a family type associated:

 

NumOrder SKU        Family type

1                 1234           Baby

1                  1245          Kid

 

This example represents an order of 2 units, with 2 different family types. The family types that I have are: Baby, Kid, Woman, Men, Men&Acessories; Woman&Acessories, Shoes. 

 

I want to create a calculated column that if an order has only Baby, display "baby", and so on. But if an order  has at least one product that is baby and kid, displays "Baby_Kid" and so on. For all combinations.

 

Can you help me?

 

Thank you!

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@jmsm 

I did not fully understand but this should be close:

Column = 
CONCATENATEX(
 CALCULATETABLE( VALUES(Table4[Family Type]) , ALLEXCEPT(Table4,Table4[Number])),
 Table4[Family Type],"|"
)

Fowmy_0-1624618528995.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@jmsm 

I did not fully understand but this should be close:

Column = 
CONCATENATEX(
 CALCULATETABLE( VALUES(Table4[Family Type]) , ALLEXCEPT(Table4,Table4[Number])),
 Table4[Family Type],"|"
)

Fowmy_0-1624618528995.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

Thank you for your reply. 

 

It is almost this. The problem is that Child| Baby and Baby| Child is the same category but I have two different categories. 

@jmsm 
Then you need to provide a propper example and show all possible scenarios.
 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors