cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bullman
New Member

Countrow Filter SQL

Hi, 

 

I recently changed my data source from Excel to SQL which has broken one of my functions. Essentially it counts how many rows are in the database based on the status, it works but I am currently receiving a delegation issue, any suggestions???

 

CountRows(Filter('[dbo].[Tickets]',Status = "In Progress")) 

 

Kind Regards,

Brett

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Bullman
The COUNTROWS function cannot be delegated in any datasource. Since you are using SQL I suggest you create a SQL View holding the count of transactions by status and use it as. datasource in PowerApps. A SQL View is read-only in PowerApps but this should be find because you are only trying to obtain the row count from it.

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

2 REPLIES 2
mdevaney
Super User
Super User

@Bullman
The COUNTROWS function cannot be delegated in any datasource. Since you are using SQL I suggest you create a SQL View holding the count of transactions by status and use it as. datasource in PowerApps. A SQL View is read-only in PowerApps but this should be find because you are only trying to obtain the row count from it.

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

eka24
Super User
Super User

Two options:
1. If it o a gallery, then remove the countries bit and just use filter. After that CountRows(GalleryName.AllItem,Status="In Progress "
2. Count the row at the back-end sql query and display the results in a textbox

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,366)