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! Learn more

Reply
sanjanarama
Resolver I
Resolver I

countrow when blank returned

I have a filter and want to display count of rows returned after search. but im not able to figure out how to write condition if blank is returned from count rows 

Total Rows = IF(ISFILTERED ('table'[Search]),COUNTROWS('table')  &  " customer match(es) found.", "No customer match(es) found.")

sanjanarama_0-1643886004241.png

 



before any search is performed im displaying below 

sanjanarama_1-1643886004242.png

 

 

1 ACCEPTED SOLUTION
sanjanarama
Resolver I
Resolver I

In case if anyone is looking for solution, i did figure out


1) first create measure to get total rows and return 0 if no rows
TotalRowsCount = IF (CALCULATE ( COUNTROWS('Table') ) = BLANK (),
0,
CALCULATE ( COUNTROWS('Table') )
)

2) create below measure to get the display 
Total Rows =
IF( ISFILTERED ('Table'[Search]) ,'Table'[TotalRowsCount] & " customer match(es) found.", "No customer match(es) found." )

sanjanarama_0-1643964113555.png

 

View solution in original post

5 REPLIES 5
sanjanarama
Resolver I
Resolver I

In case if anyone is looking for solution, i did figure out


1) first create measure to get total rows and return 0 if no rows
TotalRowsCount = IF (CALCULATE ( COUNTROWS('Table') ) = BLANK (),
0,
CALCULATE ( COUNTROWS('Table') )
)

2) create below measure to get the display 
Total Rows =
IF( ISFILTERED ('Table'[Search]) ,'Table'[TotalRowsCount] & " customer match(es) found.", "No customer match(es) found." )

sanjanarama_0-1643964113555.png

 

amitchandak
Super User
Super User

@sanjanarama , If you trying this for the search of a standard slicer, I doubt that. This can work with text search

https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104381309?src=office&tab=Overview

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  
I'm using same slicer, the measure which is posted im displaying it if my table returns a result after search from slicer

@sanjanarama , using text filter I tried this and it worked. On my data

 

 

Measure = if(ISFILTERED('Item'[Brand]), "Selected in " & Distinctcount('Item'[Brand]) , "Not selected")
 
or

Measure = if(ISFILTERED('Item'[Brand]), "Selected in " & CONCATENATEX(distinct('Item'[Brand]),[Brand]," ,") , "Not selected")

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

but if a text is searched which is not in dataset it returns as below, it should display "0 customer match(es) found", how do we achive that

sanjanarama_0-1643894077039.png

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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