OpenBI Docs Buy

APPROXIMATEDISTINCTCOUNT

The number of distinct values in a column, counted exactly: OpenBI has no DirectQuery source to estimate it on.

Group: Aggregation. Compatible with DAX.

Syntax

APPROXIMATEDISTINCTCOUNT ( <columnName> )
ParameterTypeDescription
columnNameColumnThe column whose different values are counted.

Returns

Whole number. How many different values the column has in the current filter context, blank included.

Remarks

  • Power BI offers this function to estimate a distinct count cheaply on a DirectQuery source. OpenBI reads its data into its own engine, so there is nothing to estimate: the count is exact, the same number DISTINCTCOUNT gives.
  • A measure written for Power BI with it keeps working and gives the precise figure.

Compared with DAX

Power BI may return an estimate on a DirectQuery source; OpenBI always returns the exact count.

Examples

Shops that bought something

The same answer as DISTINCTCOUNT, as OpenBI counts exactly.

EVALUATE
ROW (
    "Approximate", APPROXIMATEDISTINCTCOUNT ( Sales[Shop] ),
    "Exact", DISTINCTCOUNT ( Sales[Shop] )
)
ApproximateExact
1515

DISTINCTCOUNT, DISTINCTCOUNTNOBLANK, COUNTROWS.

Last updated · OpenBI Studio 0.3.74