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
Mainer04401
Helper III
Helper III

Create new "all other" row by calculating values of other rows

The application I use to pull data is not allowing me to pull all products sales because it's above the maximum amount of data allowed to be pulled.  Instead, I can pull select product sales and an aggregate sales of all products.  Is there a way in Power BI for me to create a new row in the products column or create a new column that subtracts the sales of the select products from the aggregate sales so that I can have an "all other products" row? 

 

Maybe something like IF [Product] not equal to "Aggregate" then show the rows and values as is, but if [Product] = "Aggregate" then subtract the products sum from the aggregate sum.  

1 ACCEPTED SOLUTION
JarroVGIT
Resident Rockstar
Resident Rockstar

Well you were on the right track already! 🙂 

Measure = 
IF(HASONEVALUE(Table1[Product),
   IF(SELECTEDVALUE(Table1[Product]) = "Aggregrate", 
        CALCULATE(SUM(Table1[Sales], FILTER(ALL(Table1), Table1[Product] = "Aggregrate"))-
       CALCULATE(SUM(Table1[Sales], FILTER(ALL(Table1), Table1[Product] <> "Aggregrate")),
        CALCULATE(SUM(Table1[Sales], FILTER(ALL(Table1), Table1[Product] = SELECTEDVALUE(Table1[Product]))))

Something like this might work (note: untested and written without intellisense). It basically checks if, in the current filtered context, Product has only 1 value and if that value is Aggregate, it sums everything with 'agregrate' and subtracts everything else (not Aggregrate). Otherwise, sum sales of the current selected value of Product.

Let me know if this works for you 🙂

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
JarroVGIT
Resident Rockstar
Resident Rockstar

Well you were on the right track already! 🙂 

Measure = 
IF(HASONEVALUE(Table1[Product),
   IF(SELECTEDVALUE(Table1[Product]) = "Aggregrate", 
        CALCULATE(SUM(Table1[Sales], FILTER(ALL(Table1), Table1[Product] = "Aggregrate"))-
       CALCULATE(SUM(Table1[Sales], FILTER(ALL(Table1), Table1[Product] <> "Aggregrate")),
        CALCULATE(SUM(Table1[Sales], FILTER(ALL(Table1), Table1[Product] = SELECTEDVALUE(Table1[Product]))))

Something like this might work (note: untested and written without intellisense). It basically checks if, in the current filtered context, Product has only 1 value and if that value is Aggregate, it sums everything with 'agregrate' and subtracts everything else (not Aggregrate). Otherwise, sum sales of the current selected value of Product.

Let me know if this works for you 🙂

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





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

Proud to be a Super User!




Worked brilliantly, thank you!  I changed the formula a bit because the TOTALS weren't populating.  I remove the HASONEVALUE string and everything still appears to work as need.  

 

   IF(SELECTEDVALUE(Table1[Product]) = "Aggregate",
        CALCULATE(SUM(Table1[Sales]), FILTER(ALL(Table1), Table1[Product] = "Aggregate"))-
       CALCULATE(SUM(Table1[Sales]), FILTER(ALL(Table1), Table1[Product] <> "Aggregate")),
        CALCULATE(SUM(Table1[Sales])))

 

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.