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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Shuchita_Jain
New Member

Creating "Others" Category with static category, Not Top N

Hi, 

 

I have a table with 25 categories (Let's just say Apple, Beet, Carrot, Donut, Emu, Fig ....so on). The names are not always going to be same and new name may get added or deleted over the quarters. But I know Apple, Peaches, Grapes and Melon are going to be part of my set and I am only interested to find out the sales data for these categories. I want to show a pie chart or bar chart with only these four categories and rest everything to go in "Others" category. I want a way to keep my fixed category on chart while others can get dynamically updated. How the DAX will work for this?

Thanks for help!

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Shuchita_Jain ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a calculated column as below:

Category =
IF (
    'Table'[Fruits] IN { "Apple", "Peaches", "Grapes", "Melon" },
    'Table'[Fruits],
    "Others"
)

yingyinr_0-1663053104709.png

2. Create a pie chart and apply the category field on the visual

yingyinr_1-1663053154997.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Shuchita_Jain ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. Create a calculated column as below:

Category =
IF (
    'Table'[Fruits] IN { "Apple", "Peaches", "Grapes", "Melon" },
    'Table'[Fruits],
    "Others"
)

yingyinr_0-1663053104709.png

2. Create a pie chart and apply the category field on the visual

yingyinr_1-1663053154997.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ValtteriN
Super User
Super User

Hi,

By selecting the "new group" from here:

ValtteriN_0-1662977050310.png

 

You can create such group:

ValtteriN_1-1662977076388.png

ValtteriN_3-1662977308710.png

 

Here my test data has 4 different attributes and I grouped "price 1 and Price 2" to a group and other values are in the other group.


Now if I add a new attribute it will automatically be placed in the other group.

E.g. (price 5)

ValtteriN_2-1662977215227.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.