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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.