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> )
| Parameter | Type | Description |
|---|---|---|
columnName | Column | The 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
DISTINCTCOUNTgives. - 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] )
)
| Approximate | Exact |
|---|---|
| 15 | 15 |