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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Worldbreaker
Helper I
Helper I

Addition, sum logic in Power BI

I am having issues with how Power BI sums up my data.

 

basically, here is an example of my data:

FruitsBasket 1Basket 2Basket 3total FruitAdditional Fruits on basket
Apple   1 
Apple Peach 11
Apple   1 
OrangeApple  11
Orange Apple 11
Orange  Apple11
Orange   1 
PeachOrange  11
Peach   1 

 

 

and this is the intended visualization:

FruitsTotal FruitsTotal Additonal
Apple33
Orange41
Peach21

 

instead what I get is:

FruitsTotal FruitsTotal Additonal
Apple31
Orange43
Peach21

*in the total additional, its summing up everything that appears in all basket for oranges, even if it's for Apples and not Oranges

 

how can I get to the intended output?

 

Thanks!!

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Worldbreaker,


I try to reproduce and get the desired result, please review the following steps.

1. Click "New Table" under Modeling on Home page, type the following formula.

Table = UNION(UNION(SELECTCOLUMNS(Table1,"Basket",Table1[Basket 1]),SELECTCOLUMNS(Table1,"Basket",Table1[Basket 2])),SELECTCOLUMNS(Table1,"Basket",Table1[Basket 3]))

2. Create another new table based on the table above.

Table 2 = SUMMARIZE(FILTER('Table','Table'[Basket]<>BLANK()),'Table'[Basket],"Additional",COUNTA('Table'[Basket]))

2.PNG

3. Create a relationship between your table, and the new 'Table 2'.

3.png

4. Create a table visual, select the sum of total fruit, the 'Table 2'[Additional] but don't summarize, you will get the right result.

4.PNG

Thanks,
Angelia

View solution in original post

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Worldbreaker,


I try to reproduce and get the desired result, please review the following steps.

1. Click "New Table" under Modeling on Home page, type the following formula.

Table = UNION(UNION(SELECTCOLUMNS(Table1,"Basket",Table1[Basket 1]),SELECTCOLUMNS(Table1,"Basket",Table1[Basket 2])),SELECTCOLUMNS(Table1,"Basket",Table1[Basket 3]))

2. Create another new table based on the table above.

Table 2 = SUMMARIZE(FILTER('Table','Table'[Basket]<>BLANK()),'Table'[Basket],"Additional",COUNTA('Table'[Basket]))

2.PNG

3. Create a relationship between your table, and the new 'Table 2'.

3.png

4. Create a table visual, select the sum of total fruit, the 'Table 2'[Additional] but don't summarize, you will get the right result.

4.PNG

Thanks,
Angelia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.