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

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

Anonymous
Not applicable

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

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.

Top Solution Authors