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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sanjanarama
Resolver I
Resolver I

countrow when return zero or blank

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-1643884170156.png



before any search is performed im displaying below 

sanjanarama_1-1643884237618.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

 

ValtteriN
Super User
Super User

Hi,

Try using ISBLANK. So something like this:

Total Rows = IF(ISFILTERED ('table'[Search]),

IF(ISBLANK(COUNTROWS('table') ), "No customer match(es) found.",

COUNTROWS('table')  &  " customer match(es) found.", "No customer match(es) found."))

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ValtteriN 
Too many arguments were passed to the IF function. The maximum argument count for the function is 3.

im getting above error when i use the dax 

@sanjanarama  There was a problem with the brackects. Here is the modified verison:

IF(ISFILTERED ('table'[Search]),

IF(ISBLANK(COUNTROWS('table') , "No customer match(es) found.",

COUNTROWS('table') & " customer match(es) found.", "No customer match(es) found.")))




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I'm sorry "Too many arguments were passed to the ISBLANK function. The maximum argument count for the function is 1."

this is error im seeing

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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