Table.ApproximateRowCount

This function will provide an estimate of the total number of rows in the table. If the data source does not support approximation, an error message will be returned instead.

Syntax

Table.ApproximateRowCount(table as table) as number

About

This function will provide an estimate of the total number of rows in the table. If the data source does not support approximation, an error message will be returned instead.

Explanation

Calculate the approximate number of unique combinations of city and state in a table to provide a cardinality estimate for the columns. Cardinality estimates play a crucial role, with databases like SQL Server offering support for this estimation using the HyperLogLog algorithm. To achieve this, utilize Power Query MTable function ApproximateRowCount to select and count distinct combinations of city and state from the SQL table. The output will be the estimated number of unique combinations.