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
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
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.