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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Regular Visitor

SUM a column filtering out duplicates of another column and filter on values in a third column

Hello Smart Folk!

I have a large table of data where multiple clients are associated to the same proposal.

I would like to calculate the sum of "GP" of "Sold" and "Almost Sold" but not include duplicates of the same proposal or "No Sale".

In the sample data below, the total should be $11,000 (2800+2800+2200+3200).


I tried creating an intermediate measure with:

DistinctSold = MAXX(DISTINCT('Table'[Proposal]),SUM('Table'[GP]))

But I get the error "Function 'MAXX' is not supported in this context in DirectQuery mode."


Any ideas?


See sample table:

Bobabc $2,800.00 Sold
Joeabc $2,800.00 Sold
Marybcd $2,800.00 Sold
Suecde $2,200.00 Almost Sold
Ellencde $2,200.00 Almost Sold
Frankcde $2,200.00 Almost Sold
Timdef $2,500.00 No Sale
Billdef $2,500.00 No Sale
Jimefg $3,200.00 Sold


Regular Visitor


Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors