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
Rogerx98
Frequent Visitor

DAX Matching Any String of Zero or more characters

Hello,

 

I'm creating a Metric. I need to use a CALCULATE formula where Im doing a DISTINCTCOUNT of a filtered table. The thing is that the filter is conformed by many different string codes "A1.01", "A1.02", "A1.03", etc.

Is there any shortcut to fetch all these variations with one line of code? Similar to Regex "A1.0%".

 

Metric1 = CALCULATE(DISTINCTCOUNT(Table[Column]), FilterTable[Code] = "A1.01" || FilterTable[Code] = "A1.02" || ...)

 

Thanks!

1 ACCEPTED SOLUTION
HobbyS
Regular Visitor

Could you use LEFT(FilterTable[Code], 4) and the compare it to "A1.0"?

View solution in original post

1 REPLY 1
HobbyS
Regular Visitor

Could you use LEFT(FilterTable[Code], 4) and the compare it to "A1.0"?

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
Top Kudoed Authors