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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to sum one column based on another column, but keep filter selection applied on table?


I have a table, and a set of slicers that filter the table.

KimberleyTayJY_0-1663910810482.png


Currently, I am using the "customers" slicer to filter the "billing account name" column.
I want to display the "ecom source name" with the highest number of "total duitable shpmts" in another advanced card visualisation. To do that, I need to sum up the "total duitable shpmts" column for the same "ecom source name"s. (eg. emailship should show total of 4+2=6, and ecom should show total of 4+1=5)

I have seen solutions using ALLEXCEPT, and I have tried using the following measure (shown in the last column of visualisation)

 

App Version Sorted Total Duitable Shpmts Col =

var VarId= 'CIN Data Quality'[Ecom Source Name]
return
CALCULATE(SUM([Total Dutiable Shpmts]), FILTER('CIN Data Quality','CIN Data Quality'[Ecom Source Name]=VarId))

 

 But I am getting results that are disregarding the values for "billing account name" a.k.a "customers" in the filter selection.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try Like

 

CALCULATE(SUM([Total Dutiable Shpmts]), FILTER(allselected('CIN Data Quality'),'CIN Data Quality'[Ecom Source Name]=Max('CIN Data Quality'[Ecom Source Name])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try Like

 

CALCULATE(SUM([Total Dutiable Shpmts]), FILTER(allselected('CIN Data Quality'),'CIN Data Quality'[Ecom Source Name]=Max('CIN Data Quality'[Ecom Source Name])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

You're an expert! Thank you so much! 👍

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.