The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
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
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