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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
punksterz626
Helper II
Helper II

Measure that includes does not contain and countrows

Hi All,

 

I'm having an issue with the following measure

 

calculate(COUNTROWS(Query1),Query1[DURATION]<>BLANK(),FILTER(Query1,Query1[CodeName]<>"%SVC%"))

 

The objective is to count rows that are not blank; however, i have 5 rows that have a value of "0" which should be included in this measure but it is not. It seems as though 0 is considered a blank. I also want to exclude anything that has "SVC" in the CodeName column, but it doesn't look like it is doing that with the above measure. Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @punksterz626 ,

 

According to my understanding, you want to count rows when [DURATION] <>BLANK and [CodeName] do not contains "SVC".

 

Please try:

Measure = CALCULATE(COUNTROWS('Query1'),FILTER('Query1',ISBLANK([DURATION])=FALSE() && CONTAINSSTRING([CodeName],"SVC")=FALSE()))

 Output:

Eyelyn9_0-1649649422585.png

 

Best Regards,
Eyelyn Qin
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 @punksterz626 ,

 

According to my understanding, you want to count rows when [DURATION] <>BLANK and [CodeName] do not contains "SVC".

 

Please try:

Measure = CALCULATE(COUNTROWS('Query1'),FILTER('Query1',ISBLANK([DURATION])=FALSE() && CONTAINSSTRING([CodeName],"SVC")=FALSE()))

 Output:

Eyelyn9_0-1649649422585.png

 

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

Thank you! This works perfectly. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors