Power Pivot Principles: The A to Z of DAX Functions – APPROXIMATEDISTINCTCOUNT
22 March 2022
In our long-established Power Pivot Principles articles, we continue our series on the A to Z of Data Analysis eXpression (DAX) functions. This week, we look at APPROXIMATEDISTINCTCOUNT.
The APPROXIMATEDISTINCTCOUNT function
The DAX function DISTINCTCOUNT counts the number of distinct (unique) values in a column. It has the following syntax to operates:
DISTINCTCOUNT(column)
where:
- column is the column that contains the values to be counted.
In the image above, DISTINCTCOUNT(Country) would return a value of two [2].
APPROXIMATEDISTINCTCOUNT returns the approximate number of rows that contain distinct values in a column of data. This function can query large amounts of data with potentially better performance than DISTINCTCOUNT, with a possible slight deviation from the exact result.
It has the following syntax:
APPROXIMATEDISTINCTCOUNT(column)
where:
- column is the column that contains the values to be counted. This may not be an expression.
This function returns the number of distinct values in column. The only argument allowed in this function is a column. We can use columns containing any type of data. When the function finds no rows to count, it returns BLANK; otherwise, it returns the count of distinct values.
Come back next week for our next post on Power Pivot in the Blog section. In the meantime, please remember we have training in Power Pivot which you can find out more about here. If you wish to catch up on past articles in the meantime, you can find all of our Past Power Pivot blogs here.