Forum Discussion
Michael09
8 years agoFrequent 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: ...
- 8 years ago
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
MikeJohnsonZA
8 years agoResponsive Resident
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
- Michael098 years agoFrequent Visitor
Perfect, thank you
- PhilDanley4 years agoAdvocate I
Thank you for the post, Mike. Solved my failed wildcard attempt for filtering in CALCULATE.