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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors