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
aridavid
Frequent Visitor

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':

aridavid_0-1599051810791.png

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:

image.png

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:

image.png

'Pants' & 'Shoes':

image.png

I just made up the slicers as a demonstration.

 

Thanks in advance!

4 REPLIES 4
Greg_Deckler
Super User
Super User

@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. https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

 

And the solution comes with a nice poem...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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

amitchandak
Super User
Super User

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

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.