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

Calculated Measure using filters based on multiple values in one column.

I want to sum values in a column, as long as another column matches multiple values.

 

Currently, I can get the calculation to work if I only match to a single value of "08 Contract Signed". Listed equation below.

MAY 2019 =

CALCULATE(

    SUM('AD_HOC Opportunity_ALL'[Expected_Value]),

ALL('AD_HOC Opportunity_ALL'[Stage]), 'AD_HOC Opportunity_ALL'[Stage] = "08 Contract Signed",

    'AD_HOC Opportunity_ALL'[Opp_Close_Month] IN { "2019-05" }

)

 

 

However, if I try to filter by multiple values I receive an error message. Example below.
(I replaced "08 Contract Signed" in the above equation, with additional items in a {} list)

MAY 2019 =

CALCULATE(

    SUM('AD_HOC Opportunity_ALL'[Expected_Value]),

ALL('AD_HOC Opportunity_ALL'[Stage]), 'AD_HOC Opportunity_ALL'[Stage] = {"08 Contract Signed", "07 Signature", "05 Written Notice"},

    'AD_HOC Opportunity_ALL'[Opp_Close_Month] IN { "2019-05" }

)

 

Why is the second equation not working? Can I create a calculated measure to sum one column, if another column matches one of multiple values?

1 ACCEPTED SOLUTION
Levajar
Advocate II
Advocate II

1 REPLY 1
Levajar
Advocate II
Advocate II

Did you try using IN operator instead of = ? 

https://community.powerbi.com/t5/Desktop/How-to-use-filter-with-multiple-values-in-DAX/td-p/225922

 

Hope the above link helps!

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.