Undoubtedly, it is possible to count distinct values in Power BI with a filter in place. Here’s how you can achieve it:
Employing the DISTINCTCOUNT function: In addition, Power BI contains the DISTINCTCOUNT function, which returns the count of distinct values in a particular column. In this case, one can combine this function with a filter to count the number of unique values that pass certain criteria.
Introduce a filter: There are various ways in which filters can be introduced. For instance, a user can utilize a slicer, visual level filters, or DAX such as CALCULATE to place a condition. DAX being applied, this could be the formula:
DistinctCountWithFilter = CALCULATE(DISTINCTCOUNT(Table[Column]), Table[Condition] = "Value")
This calculates the number of different entries in a certain data frame column, but only for the entries that satisfy the filtering criteria (for example, when one of the data frame columns takes on particular values).
Visual Filters: If you are in a report, you can also use a visual filter on your table or chart, which will filter the information before the distinct count takes place.
This process helps Count Unique Values even while Filtering in Power BI.