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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Filter on Calculate Sum

Hi All,

 

I am trying to do the below calculation to sum the Annual GP based a couple of filters, but as soon as I try and do the filter actualclosedate>X then it doesn't work and just sums all Annual GP. See below formula, can someone take a look and see where I am going wrong.

 

AGP Removed = CALCULATE(SUM(Opportunity[Annual GP]),Opportunity[new_ContractType]=279640002||Opportunity[new_ContractType]=279640000||Opportunity[new_ContractType]=957500000, Opportunity[ActualCloseDate]>15/01/2020)
 
I have tried the date format in UK and US but doesn't make a difference.
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try this measure:

 

AGP Removed =
CALCULATE (
    SUM ( Opportunity[Annual GP] ),
    (Opportunity[new_ContractType] = 279640002
        || Opportunity[new_ContractType] = 279640000
        || Opportunity[new_ContractType] = 957500000) &&
    Opportunity[ActualCloseDate] > DATE( 2020, 1, 15)
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Give date like

date(2020,1,15)

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
Pragati11
Super User
Super User

Hi @,

 Can you please try the following DAX expression please:

 

AGP Removed = CALCULATE(
                                                SUM(Opportunity[Annual GP]),
                                                FILTER('Opportunity',
                                                             (Opportunity[new_ContractType]=279640002 || Opportunity[new_ContractType]=279640000                                                                 || Opportunity[new_ContractType]=957500000)

                                                               && (Opportunity[ActualCloseDate]>15/01/2020)    
                                                           )
                                              )

 

If this helpf give Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

MFelix
Super User
Super User

Hi @Anonymous ,

 

Try this measure:

 

AGP Removed =
CALCULATE (
    SUM ( Opportunity[Annual GP] ),
    (Opportunity[new_ContractType] = 279640002
        || Opportunity[new_ContractType] = 279640000
        || Opportunity[new_ContractType] = 957500000) &&
    Opportunity[ActualCloseDate] > DATE( 2020, 1, 15)
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks Miguel! That has worked.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors