Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
So my data looks something like this:
flavor_ratio | Value |
1 | meat |
2 | chicken |
7 | veggies |
10 | chicken |
9 | meat |
But of course, it goes for thousands of rows. Now when I want to visualise a pie chart, it would look something like this:
Meat 98%, veggies 1% and chicken 1%. I need it like this: Meat 98%, Others 2%. Basically everything under 2% should be grouped under others. How can I achieve this? I need it to respect any filters that I am applying as well.
@Anonymous Let's try another approach by creating a measure.
FlavorPercentage =
DIVIDE(
COUNTROWS(FILTER(FlavorData, FlavorData[Value] = EARLIER(FlavorData[Value]))),
COUNTROWS(FlavorData)
) * 100
Create another measure
FlavorCategory =
IF([FlavorPercentage] >= 2, [Value], "Others")
These will return "Others" for flavors with less than 2% and the flavor name for those with 2% or more.
Apply filters to the Pie Chart and see the result.
==========OR try another approach
FlavorPercentage2 =
COUNTROWS(FILTER(FlavorData, FlavorData[Value] = EARLIER(FlavorData[Value]))
) / COUNTROWS(FlavorData)
Drag a "Bar Chart" or "Column Chart" visualization to the canvas.
Add the "Value" field to the "Axis" or "Category" field well.
Add the "FlavorPercentage" measure to the "Values" field well.
You may want to customize the chart to make it more readable:
Sort the chart by percentage.
Adjust the axis labels and formatting.
================ OR try
Grouped Value = IF(SUM('Table'[flavor_ratio]) / SUMX(ALL('Table'), 'Table'[flavor_ratio]) < 0.02, "Others", MAX('Table'[Value]))
Reference :
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning
Hi @Anonymous can you create a new column Percentage = DIVIDE([flavor_ratio], SUMX(TableName, [flavor_ratio])) * 100
Create another calculated column to group values under 2% as "Others."
Grouped Value = IF([Percentage] < 2, "Others", [Value])
create a pie chart visual.
Drag the "Grouped Value" column to the "Values" field well of the pie chart.
You can also drag the "Percentage" column to the "Values" field to display the percentages on the chart.
With these steps, your pie chart should display "Meat," "Chicken," and "Others" as categories based on the percentage threshold of 2%. This chart will also respect any filters you apply to your data.
You can customize your chart as needed, adding labels, titles, and legends to make it more informative.
Please let me know if this work
Thanks
Hi dallasbabatunde,
Thank you so much for this but I tried this already and it just gives me 100% others. I should note that most flavor ratios that i have are indeed below 1, like 0.something. So the new calculated column just shows others for all calculations.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
10 |