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
Dellis81
Continued Contributor
Continued Contributor

Calculate with filter wildcard text

Hello - I am needing assistance with a dax calculate w/filter measure for excluding rows with a certain phrase.

 

The below measure appears to be working, excluding those rows not matching "Labor Cost Allocation Offset".

 

Production Costs excl offset1 = calculate([IS Production Costs],filter('Consolidated Transactions','Consolidated Transactions'[Vendor]<> "Labor Cost Allocation Offset"))
 
However, I want to expand the exclusion phrase to include other types of "Allocation Offset".   Within the filter, I have tried the wildcard "%Allocation Offset%", but that does not appear to work. 
 
Production Costs excl offset1 = calculate([IS Production Costs],filter('Consolidated Transactions','Consolidated Transactions'[Vendor]<> "%Allocation Offset%")).
 
In my forum research, I have seen reference to the % as a wildcard, but other articals indicate I need to use the search function.   I have not been successful with the search approach.
 
I have 8-10 vendor names with the phrase "Allocation Offset", I could try the || (or) function, but suspect my Allocation offset list could grow over time.  Thus my hope for a solution with the key phrase:  "Allocation Offset".
 
thanks
2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@Dellis81 

 

You may try using CONTAINSSTRING.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you - yes, I had tried that and am sure that is the answer to my question.   I was having trouble with the multiple conditions using the "or" operator and the "||" operator.   I ended up changing things in the PowerQuery to make this work.  But, I will keep this in mind, as i am sure this will come up again.

 

Thank you!

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Dellis81 

 

You may try using CONTAINSSTRING.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you - yes, I had tried that and am sure that is the answer to my question.   I was having trouble with the multiple conditions using the "or" operator and the "||" operator.   I ended up changing things in the PowerQuery to make this work.  But, I will keep this in mind, as i am sure this will come up again.

 

Thank you!

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.

Top Solution Authors