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
SindijaL
Regular Visitor

Other category in pie chart

Hello,
I would like to add "other" category to a pie chart. The existing categories in the dataset do not add up to the total, hence "other" needs to be calculated. The illustration below illustrates what I am dealing with (Version 1) and what I would like to accomplish (Version 2). Any ideas on how to do this?

 

OtherCategories.PNG

 

 

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

Hi @SindijaL ,

 

Please try:

First create a new table:

vjianbolimsft_0-1672640464736.png

Then apply the measure to the visual:

Measure = 
var _a = CALCULATE(SUM(Data[Volume_tons]),FILTER('Data',[Retailer]=MAX('Table'[Retailer])))
var _b = CALCULATE(SUM(Data[Volume_tons]),FILTER('Data',[Retailer]<>"Total"))
var _c = CALCULATE(SUM(Data[Volume_tons]),FILTER('Data',[Retailer]="Total"))
return IF(MAX('Table'[Retailer])="Others",_c-_b,_a)

Final output:

vjianbolimsft_1-1672640521980.png

 

Best Regards,

Jianbo Li

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

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @SindijaL ,

 

Please try:

First create a new table:

vjianbolimsft_0-1672640464736.png

Then apply the measure to the visual:

Measure = 
var _a = CALCULATE(SUM(Data[Volume_tons]),FILTER('Data',[Retailer]=MAX('Table'[Retailer])))
var _b = CALCULATE(SUM(Data[Volume_tons]),FILTER('Data',[Retailer]<>"Total"))
var _c = CALCULATE(SUM(Data[Volume_tons]),FILTER('Data',[Retailer]="Total"))
return IF(MAX('Table'[Retailer])="Others",_c-_b,_a)

Final output:

vjianbolimsft_1-1672640521980.png

 

Best Regards,

Jianbo Li

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

AbbasG
Memorable Member
Memorable Member

@SindijaL Can you explain in the first version how the total is more? without any added rows/values?

if you can share sample data, I might be able to help you better.

Hi,

Please see the example here: PowerBi Chart 

This is the format I receive the data in directly from the source. Multiple retailers are included, as well as a "Total" value for each time period. "Total" does not equal the sum of available retailers because there are other ertailers that are included in "Total" but not stated. I would like to track the market share of each retailer. Currently the sum of available retailers adds up to 57.8% of "Total", implying that "Others" account for 42.2%. I would like to create this "Other" category and display it in the pie chart alongside available retailers.

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.