Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I'm looking for some advice on how I can create a measure that counts the number of customers that do not have a specific event recorded against them. An example of this is:
I would like to create a calculation which searches for specific text in the Customer Notes table and then filters the Customer Count measure to include Customers that don't have the search string in a Customer Note.
I've tried doing it the other way round first, calcualting the customer count that does have a specific text in a note, but I'm not having much luck:
Missing Fee Note =
CALCULATE(
[Customer Count],
FILTER ( Customer, CONTAINSSTRING ( 'Customer Note'[Note Text], "search text" ) )
I get an error above which says that it can't determine a single value. Any help or pointers would be appreicated.
Thanks
Solved! Go to Solution.
@DavidC2020 , make sure Customer Count is a measure
Try like example
CALCULATE(
count(Sales[Customer ID]) ,
FILTER ( Customer, not CONTAINSSTRING ( 'Customer Note'[Note Text], "search text" ) ) //added not , remove as per need
Hi @DavidC2020 ,
You can try the following methods.
Here's my test table:
Customer Note Table:
Customer Table:
Sales Fact Table:
Measure:
Missing Fee Note =
CALCULATE (
[Customer Count],
FILTER (
ALL ( 'Customer Note' ),
CONTAINSSTRING ( 'Customer Note'[Note Text], "fail" )
)
)
In your code, the first argument to the filter function should probably be used Customer Note.
Missing Fee Note =
CALCULATE(
[Customer Count],
FILTER ( Customer, CONTAINSSTRING ( 'Customer Note'[Note Text], "search text" ) )
Is this the result you expect?
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for the example. I was looking for instances where the text was not contained within the string.
@DavidC2020 , make sure Customer Count is a measure
Try like example
CALCULATE(
count(Sales[Customer ID]) ,
FILTER ( Customer, not CONTAINSSTRING ( 'Customer Note'[Note Text], "search text" ) ) //added not , remove as per need
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |