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

What's the easiest way to group data

 

Hi, how to group "Detail" like below in power BI, it's quite a lot under "detail" may need to add into the query on regular basis if any new ones appears under "detail".   i know the way to add a column may dax=IF(C7="red","color",IF(C7="banana","fruit"))  but that will end very mass as the long list under "detail", is there a easy way to do this?

 

DetailCategory
redcolor
bananafruit
bluecolor
applefruit
yellowcolor
1 ACCEPTED SOLUTION

you have to create a two helper tables 

 

Fruit

Banana

Apple

orange

 

and

Color

Yellow

Red

Blue

 

Create a relationship between these tables and you can group and aggregate the data. It doesn't automatically recognize that whether it is color or fruit. you have to create a relationship between bridge tables and your data.

 

This would solve your problem. let me know if you get stuck.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

10 REPLIES 10
BhaveshPatel
Community Champion
Community Champion

Your requirements are bit confusing. 

 

Can you please explain what do you actually want to do with your data. What do you mean by grouping.

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

@BhaveshPatel  see my first table, i want to group or categorise "detail" data into group or category, for example, "red" goes to "color", "apple" goes to "fruit".

 

thanks

PowerBI automatically aggragates the data depending on your data type. for text data type, it will count the values and for number data type, it sums up the data.Bar GraphBar GraphTable VisualizationTable Visualization

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

i mean i only got the "detail" data, apple, red, blue, banana...etc.   I would like to group them into "color" "fruit" so i can chart them.

you have to create a two helper tables 

 

Fruit

Banana

Apple

orange

 

and

Color

Yellow

Red

Blue

 

Create a relationship between these tables and you can group and aggregate the data. It doesn't automatically recognize that whether it is color or fruit. you have to create a relationship between bridge tables and your data.

 

This would solve your problem. let me know if you get stuck.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

@BhaveshPatelthat's what i'm doing now in excel, but just want to confirm there is no easy way in power bi.   thanks for the help.

custom.PNG

You can create the custom column in powerquery using the logic shown above and it will solve your problem dynamically.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Unfortunately not. 

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
BhaveshPatel
Community Champion
Community Champion

Use Group_By feature of the PowerQuery to solve this problem.

 

It is Dynamic and would solve your problem of manually updating the formula.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

@BhaveshPatel thanks, but i can't find "contain" under "operation"? do you mind explain a bit detail?

 

 

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.