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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
lennox25
Post Patron
Post Patron

How to filter/count with contains and any blanks as 0

I have this measure but want to adapt is as what I am searching for markets is contained in the sentence. The measure below is fine for what I needed it for but doesnt work as markets is within a sentence. Can anyone help? Please? Thank you

 

No of  Batch = if(ISBLANK(CALCULATE(
COUNT('table'[ID]),
FILTER('table', table[category] = " Batch"))),0,CALCULATE(
COUNT('table'[ID]),
FILTER('table', table[category] = "Batch")))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lennox25 

 

With reference to the information provided by you, I ran the following tests:

Here's my test data.

vxuxinyimsft_0-1703060538142.png

 

Then I created the following measure:

 

isBatch = FIND("Batch", SELECTEDVALUE('Table'[category]), 1, 0)
No of Batch = COUNTX(FILTER('Table', 'Table'[isBatch] > 0), 'Table'[ID])

 

 

vxuxinyimsft_1-1703060647717.png

Is this the result you expect?

 

Best Regards,

Community Support Team_Yuliax

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @lennox25 

 

With reference to the information provided by you, I ran the following tests:

Here's my test data.

vxuxinyimsft_0-1703060538142.png

 

Then I created the following measure:

 

isBatch = FIND("Batch", SELECTEDVALUE('Table'[category]), 1, 0)
No of Batch = COUNTX(FILTER('Table', 'Table'[isBatch] > 0), 'Table'[ID])

 

 

vxuxinyimsft_1-1703060647717.png

Is this the result you expect?

 

Best Regards,

Community Support Team_Yuliax

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Very much 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.