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

COUNT including wildcard

Hi

Totally new to Power BI and DAX but familiar with SQL.

I'm trying to use a measure to count the number of unique refs in a field that begin with the number 7

 

The field contains data like:

 

71234

73265

36584

75657

56834

46984

 

So in this example I would want the result to return '3'

 

Many thanks

1 ACCEPTED SOLUTION

Hi

 

You can use the distinct count function to count distinct values and the calculate function to filter for the numbers starting with 7,

your measure could look something like this

 

My Measure:=CALCULATE(DISTINCTCOUNT(Table1[MyValue]),left(Table1[MyValue],1)="7")

 # You would need to change the table and column name

View solution in original post

3 REPLIES 3

Hi

 

You can use the distinct count function to count distinct values and the calculate function to filter for the numbers starting with 7,

your measure could look something like this

 

My Measure:=CALCULATE(DISTINCTCOUNT(Table1[MyValue]),left(Table1[MyValue],1)="7")

 # You would need to change the table and column name

Thank you for the post, Mike. Solved my failed wildcard attempt for filtering in CALCULATE.

Perfect, 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.