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
Gazsim44
Helper III
Helper III

IF & CONTAINS with Multiple Values

Hi All, 

 

I am trying to write a measure which is required to lookup text values in a column and then complete a simple division if the results are true. This proved easy enough when only one value was required but now I need two - the result basically being if either of the two applies then the division will be the result, if not then it should just be blank.

 

The measure I had for one was as follows;

Measure = IF(CONTAINS('Data','Data'[Category],"GP"),
    DIVIDE([Current Year Actual],[Current Year Budget]))

 

Many thanks, 

1 ACCEPTED SOLUTION
judspud
Solution Supplier
Solution Supplier

Hi @Gazsim44 

 

You could use the OR function.

 

Measure = IF(OR(CONTAINS('Data','Data'[Category],"GP"),CONTAINS('Data','Data'[Category],"Other Value")), DIVIDE([Current Year Actual],[Current Year Budget]))

 

Hope this helps

 

Thanks,

George 

View solution in original post

2 REPLIES 2
judspud
Solution Supplier
Solution Supplier

Hi @Gazsim44 

 

You could use the OR function.

 

Measure = IF(OR(CONTAINS('Data','Data'[Category],"GP"),CONTAINS('Data','Data'[Category],"Other Value")), DIVIDE([Current Year Actual],[Current Year Budget]))

 

Hope this helps

 

Thanks,

George 

Thanks George!

 

Sounds obvious now you mention it - just didnt think! 🙂

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.