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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
_Stephen
New Member

How to get total number of rows in a dataset table, is there any REST API?

Hi, 

I need to get the total no of rows present in a dataset table. Because I am usig a ExecuteQueries REST API to get the response from dataset tables. but in my case the response is too big, they contains so many no of rows, So I need to know how many total rows are there (inside a dataset table). then only i will set pagination for the response.

 

Please anyone help me to solve this issue.  

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @_Stephen ,

 

There isn’t a direct Power BI REST API endpoint to get the total number of rows in a dataset table. However, you can use the endpoint to run a DAX query that counts the number of rows in a table ExecuteQueries.

 

Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

{
  "queries": [
    {
      "query": "EVALUATE ROW(\"RowCount\", COUNTROWS('YourTableName'))",
      "queryId": "CountRowsQuery"
    }
  ]
}

This DAX query will return a table with a single row and column that contains the count of rows in ‘YourTableName’. You can then parse this count from the API response.

Please note that the endpoint has a limit of 100,000 rows or 1,000,000 values per query (whichever is hit first)ExecuteQueries. If your table has more rows than this, the count will be capped at the limit.

Also, remember to replace ‘YourTableName’ with the actual name of your table.

If you’re dealing with large datasets and you’re hitting these limits, you might need to consider other strategies for managing your data, such as filtering or summarizing your data before querying it, or using pagination as you mentioned.

 

Best regards.
Community Support Team_Caitlyn

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @_Stephen ,

 

There isn’t a direct Power BI REST API endpoint to get the total number of rows in a dataset table. However, you can use the endpoint to run a DAX query that counts the number of rows in a table ExecuteQueries.

 

Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

{
  "queries": [
    {
      "query": "EVALUATE ROW(\"RowCount\", COUNTROWS('YourTableName'))",
      "queryId": "CountRowsQuery"
    }
  ]
}

This DAX query will return a table with a single row and column that contains the count of rows in ‘YourTableName’. You can then parse this count from the API response.

Please note that the endpoint has a limit of 100,000 rows or 1,000,000 values per query (whichever is hit first)ExecuteQueries. If your table has more rows than this, the count will be capped at the limit.

Also, remember to replace ‘YourTableName’ with the actual name of your table.

If you’re dealing with large datasets and you’re hitting these limits, you might need to consider other strategies for managing your data, such as filtering or summarizing your data before querying it, or using pagination as you mentioned.

 

Best regards.
Community Support Team_Caitlyn

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.