Forum Discussion

aridavid's avatar
aridavid
Frequent Visitor
6 years ago

Sum totals from multiple columns based on filter selection

Hi,

 

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!

4 Replies