Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Sum totals from multiple columns based on filter selection



Hope you're all doing well.


Is it possible to achieve something like this: I'd like to be able to display a total value based on multiple columns where the total will vary depending on the columns I'd like to sum by using a filter.


As an example I have this data set called 'tbl_Totals':


And I've created a measure that sums the totals like this:


Grand Total = SUM('tbl_Totals'[Pants]) + SUM('tbl_Totals'[Shirts]) + SUM('tbl_Totals'[Shoes])


Which on a table looks like this:


I'm trying to create a filtering approach where I can change the grand total based on the fields I select. So if I select 'Shoes', the Grand Total will be 80. Or, if I select 'Pants' and 'Shirts', the grand total will change to 125. Example:


'Shoes' only:


'Pants' & 'Shoes':


I just made up the slicers as a demonstration.


Thanks in advance!

Super User IV
Super User IV

@aridavid - Maybe, it's not very clear though. You would probably have more luck if you unpivoted those columns in your dataset. If you do need multi-column aggregation, there is a way to do it.


And the solution comes with a nice poem...


@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!

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

Proud to be a Super User!

Hey, thanks for checking, I'll try to edit and clarify.

Super User IV
Super User IV

@aridavid , not very cleat.

You can unpivot the data and use
Transpose :

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

hanks for the hint, I'll try to clarify.

Helpful resources

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors