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
Anonymous
Not applicable

Custom column groupings

Hi,

 

I've got a column called "Products" that contains all sorts of products - for instance:

Lounge Chair

Lounge Chair Cushion, Red

Lounge Chair Cushion, Blue

Long Bench 160

Long Bench 160 Cushion

 

Is it possible to create a new column that groups "related" products together within the same "master product", like in the example below.

 

Product                                      Master Product

Lounge Chair                                       Lounge Chair

Lounge Chair Cushion, Red                 Lounge Chair

Lounge Chair Cushion, Blue                Lounge Chair

Long Bench 160                                   Long Bench

Long Bench 160 Cushion                     Long Bench

 

I hope that you can help 😉

1 ACCEPTED SOLUTION

Hi @Anonymous 

In the query editor duplicate the column Product and by using split column by space

 

close and save the query editor then in the data section create calcuate column split column.JPG

 

Master Product = 'Table'[Product - Copy.1] &" "& 'Table'[Product - Copy.2]

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@selimovd @amitchandak @Singaravelu_R 

 

Thank you for your replies.

Is it also this solution that I should use, even though i've got about 500-1000 products and probably have to create about 200 master products?

 

Or is there some way where I can just "remove" cushion (and potentially color) from the equation?

Hi @Anonymous 

In the query editor duplicate the column Product and by using split column by space

 

close and save the query editor then in the data section create calcuate column split column.JPG

 

Master Product = 'Table'[Product - Copy.1] &" "& 'Table'[Product - Copy.2]

With the SEARCH function that @amitchandak proposed you search for "Lounge Chair" and categorize it as such. If it's "Lounge Chair" or "Lounge Chair red" or "Lounge Chair with cushion" doesn't matter.

 

The search function will then categorize all as Lounge Chair.

If you need any help please let me know.


If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi

Singaravelu_R
Resolver III
Resolver III

create new calculated column. 

Master Product=

Switch( true(),
search("Lounge Chair",[Product],,0) >0 , "Lounge Chair",
search("Long Bench",[Product],,0) >0 , "Long Bench",
"Other"
)

selimovd
Super User
Super User

Hello @Anonymous ,

 

yes that's possible.

You can either group them with new calculated column. Then you can check if Product contains "Lounge Chair" then it should be "Lounge Chair". Check the SWITCH/TRUE combination for that case:

DAX - The Diabolical Genius of “SWITCH TRUE” | P3 (powerpivotpro.com)

 

Or you can click with the mouse button to the column "Product" and chose "New group". There you can group easier by just combining the results to specific groups together:

6.png

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi

amitchandak
Super User
Super User

@Anonymous , Create a new column like

 

Switch( true(),
search("Lounge Chair",[Product],,0) >0 , "Lounge Chair",
search("Long Bench",[Product],,0) >0 , "Long Bench",
"Other"
)

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.