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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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])))

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])))

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

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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