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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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