Table.ApproximateRowCount

Table

Returns an approximate row count that may be faster than Table.RowCount for large folded queries.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Table.ApproximateRowCount(table as table) as number

Parameters

NameTypeRequiredDescription
tabletableYesThe table whose approximate row count is returned.

Return Value

numberAn approximate number of rows in the table.

Remarks

Table.ApproximateRowCount returns an approximate count of rows in a table. For data sources that support query folding, this function may fold to a fast server-side approximation (such as statistics-based row estimates in SQL Server) instead of performing a full COUNT(*). This makes it much faster for large tables when an exact count is not required.

If the data source does not support an approximate count, the function may fall back to a full row count identical to Table.RowCount. Do not rely on this function when an exact count is required.

Examples

Example 1: Get an approximate row count

Table.ApproximateRowCount(Sales)
Result
Result
11,000,000

Example 2: Use as a quick size check

let
    Source = Sql.Database("server", "db"),
    Orders = Source{[Schema="dbo", Item="Orders"]}[Data],
    ApproxCount = Table.ApproximateRowCount(Orders)
in
    ApproxCount
Result
Result
15,432,100

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks