If you’ve tried counting a Dataverse table in Power Apps with CountRows, you’ve probably seen a 0 while the table holds 8 rows. To get data from Dataverse in Power Apps reliably, add the table, then read it with Filter, LookUp and CountIf.
Why the 0? CountRows on a Dataverse table reads a cached count that Dataverse only updates now and then, so it can lag behind your real data.
In this tutorial, we’ll get data from Dataverse in Power Apps step by step. We’ll connect a table to a blank canvas app, show filtered rows in a gallery, and read one record with LookUp.
Then we’ll count rows the right way, spot delegation warnings, and refresh the data. Every formula here ran in my own app on 10/21/2026.
The Sample Table We’ll Use
Every example reads one table, Service Requests, in my Power Platform developer environment. If tables, rows and columns are new to you, start with what Microsoft Dataverse is.
Dataverse is Microsoft’s database for the Power Platform. A table holds rows (records), and each column has a type, like text, choice or lookup.
| Column | Type | Note |
|---|---|---|
| Subject | Text (primary column) | Password Reset, Network Issue … |
| Request Number | Text | REQ-1000 to REQ-1009; display name ends with a space |
| Status | Choice | Open, In Progress, Closed |
| Priority | Choice | Low, Medium, High |
| Customer | Lookup | Points to the Customers table (Amy, Bob, Cleo, Dan, Eve) |
During these tests the table had 8 rows, from Hardware Repair (REQ-1000) to Monitor Flicker (REQ-1009). Four were Open: Password Reset, Software Update, Projector Setup and Monitor Flicker.
Connect a Dataverse Table to Your Canvas App
Here’s the beginner path. Dataverse lives inside an environment, so pick the right one first.
- Go to make.powerapps.com and choose your environment at the top right.
- Select Create > Start with design > Blank canvas app, pick the Tablet format and select Create.
- In Studio, open Data in the left bar and select Add data.
- Type the table name in the search box. Dataverse tables show Microsoft Dataverse – Current environment under the name.
- Select the table. That’s it: there’s no separate connection to set up, unlike SharePoint or Excel.
I searched for Service Requests. Hovering the result shows the logical name, cr85a_servicerequest, which helps when two tables share a display name.

That last tip saved me once. Searching Customers showed two Dataverse tables with the same name, and only the tooltip told them apart.
By default the app reads the current environment. Microsoft’s docs say you can use Change environment for another one, and your security role still decides which rows you can see.
You may have seen the older route too: Start with data builds a three-screen app (browse, detail, edit) from one table. It’s quick, but you learn more building screens yourself. Browse more in our Power Apps tutorials hub.
Pro Tip: Save often with Ctrl+S, and press F5 (or the Play button at the top right) to run the app in Preview. In the editor, hold Alt and click a button to run it without leaving edit mode.
Method 1: Show Dataverse Rows in a Gallery With Filter and Sort (Recommended)
Use this when people need to browse and search rows. I added a dropdown ddStatus, a text input txtSearch and a vertical gallery galGet from the Insert menu.
The dropdown’s Items is Choices('Status (Service Requests)'), so it lists Open, In Progress and Closed.
Next, select the gallery, pick Items in the property dropdown left of the formula bar, and paste this:
Sort(
Filter('Service Requests',
'Status (cr85a_status)' = ddStatus.Selected.Value,
StartsWith(Subject, txtSearch.Text)),
'Request Number ', SortOrder.Ascending)
Studio showed no delegation warning for this formula, which is exactly what you want.

With Status Open and an empty search box, the gallery showed four rows: Password Reset (REQ-1003), Software Update (REQ-1004), Projector Setup (REQ-1008) and Monitor Flicker (REQ-1009).
Typing P in the search box cut that to Password Reset and Projector Setup.

How does this work?
Filter keeps rows where both conditions are true. The first compares the Status choice to the dropdown’s selected value, and the second keeps subjects starting with the search text.
An empty search box matches every subject, so you see all Open rows. Sort then orders them by request number, A to Z.
Filter, Sort, StartsWith and = on a choice are all delegable to Dataverse. That means Dataverse runs the query on the server, so the gallery works on 8 rows or 80,000.
So here’s the catch: our table has two columns called Status. Every Dataverse table has a system Status (Active/Inactive), so Power Apps renames ours to 'Status (cr85a_status)'. I explain the clash when I cover Dataverse choice columns in Power Apps.
Show a Lookup Column in the Gallery
Customer is a lookup to another table, so the gallery row doesn’t hold a name, it holds a related record. Use dot notation to reach the column you want:
ThisItem.Customer.'Customer Name'
The label showed Cleo, Eve and Bob for the Open rows. This only works after you add the Customers table to the app too, the same way you added Service Requests.
Method 2: Get One Record With LookUp
Use LookUp when you need one row, like a request someone picked in another screen. It returns the first record that matches, or one value from it.
Here’s the formula on a label’s Text property:
LookUp('Service Requests', 'Request Number ' = "REQ-1006").Subject
The label showed Network Issue, the subject of REQ-1006.

How does this work?
LookUp checks each row against the condition and stops at the first match. .Subject then pulls just that column out of the record.
Leave off .Subject and you get the whole record, which is handy in a variable: Set(varReq, LookUp(...)). If nothing matches, LookUp returns blank.
Now look at the column name: 'Request Number ' has a space before the closing quote. Its display name has a trailing space, so 'Request Number' gave “Name isn’t valid.”
For more on picking the right function, see Filter vs Search vs LookUp in Power Apps.
Method 3: Count Dataverse Rows With CountIf Instead of CountRows
This is the symptom from the top. I put CountRows('Service Requests') on a label, and Studio showed a warning:
CountRows may return a cached value. Use CountIf(DataSource, true) to get the latest count.
The label read 0 in Studio and in Preview. A second label with this formula showed 8, the real count:
CountIf('Service Requests', true)

How does this work?
Dataverse keeps a cached row count per table and updates it periodically. CountRows on the whole table reads that cache, so a new or recently filled table can show a stale number, like my 0.
CountIf(table, true) counts rows where the condition is true, and true is true for every row. Microsoft’s docs recommend it for exact counts under 50,000 rows.
CountRows works fine on a filtered table or a gallery, like CountRows(galGet.AllItems). For more examples, see our Power Apps CountIf function guide.
Pro Tip: If CountIf still shows a delegation warning on a big table, check Settings > Upcoming features for Enhanced delegation for Microsoft Dataverse. Microsoft’s docs say it’s needed for CountIf and CountRows delegation.
Watch for Delegation Warnings When You Read Dataverse
Delegation means Power Apps hands the query to Dataverse. When a function can’t be delegated, Power Apps downloads only the first 500 rows (the default data row limit) and works on those.
Here’s a formula that looks harmless:
CountRows(Filter('Service Requests', Len(Subject) > 12))
It returned 6, which is right for 8 rows. But Studio drew a blue squiggle and two warnings: the “Len” part might not work correctly on large data sets, and neither might the Subject column.

How does this work?
Dataverse can’t run Len on the server, so Power Apps would check only the rows it downloaded. On 8 rows that’s everything. On 5,000 rows, you’d get a wrong count with no error.
The fix is to filter on something Dataverse understands, like StartsWith, = or a date range, or store the value in its own column. I walk through more fixes in Power Apps delegation warnings.
Refresh Dataverse Data in Power Apps
Galleries don’t reload on their own when someone else changes a row. Put this on a button’s OnSelect to get a fresh copy:
Refresh('Service Requests')
Refresh works only in behavior formulas, like OnSelect or OnVisible, and returns nothing. Galleries bound to the table then show other users’ changes.
Here’s what it doesn’t do: my CountRows label still said 0 after Refresh. The cache lives in Dataverse, not the app, so CountIf is the fix. More patterns are in our Power Apps Refresh function post.
Need the same data outside the app? A flow can count rows from a Dataverse table with List rows, and you can add data to a Dataverse table from Power Apps with Patch.
Which Method Should You Use?
| You need | Use | Delegable? |
|---|---|---|
| A searchable list of rows | Gallery Items = Filter + StartsWith + Sort | Yes |
| One row or one value | LookUp(table, condition).Column | Yes |
| Exact number of rows | CountIf(table, true) | Yes, up to 50,000 rows |
| Number of rows on screen | CountRows(gallery.AllItems) | Counts loaded rows |
| Other users’ latest changes | Refresh(table) on a button | – |
Things to Keep in Mind
- CountRows on a whole Dataverse table can show a stale number (I got 0). Fix: use CountIf(table, true).
- Display names can hide spaces, like ‘Request Number ‘. Fix: pick the column from IntelliSense instead of typing it.
- A custom choice called Status clashes with the system Status. Fix: use ‘Status (cr85a_status)’ in formulas.
- Len, Trim and Text() on a column aren’t delegable. Fix: filter with StartsWith, =, or a stored column.
- Lookup columns return a record. Fix: add the related table and use ThisItem.Customer.’Customer Name’.
If you build Dataverse apps at work, our Power Apps training course covers these patterns on real projects.
Want to go further with Dataverse? These pair well with this one:
Frequently Asked Questions
How do I use Dataverse in Power Apps?
Create a canvas app in the environment that holds your tables, open Data, select Add data, and pick the Dataverse table. Then use its name in formulas, like a gallery’s Items property or LookUp. No separate connection is needed.
How do I get a single record from a Dataverse table in Power Apps?
Use LookUp, for example LookUp(‘Service Requests’, ‘Request Number ‘ = “REQ-1006”). It returns the first matching record, or one column if you add .Subject. If nothing matches, it returns blank.
Why does CountRows show 0 or the wrong number for my Dataverse table?
CountRows on a whole Dataverse table reads a cached count that updates periodically. Use CountIf(table, true) for the exact count under 50,000 rows. See Microsoft Learn on CountIf and CountRows.
Which functions are delegable for Dataverse in Power Apps?
Filter, Sort, LookUp, StartsWith, CountIf and comparisons like = are delegable. Len, Trim and Text() on a column aren’t. Microsoft keeps the full list in Connect to Microsoft Dataverse.
How do I access Dataverse tables from another environment?
When you add data, select Change environment and pick the other environment, then choose the tables. Your security role there still controls which tables and rows you can see.

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.