Number of unique rows – by multiple columns
This tutorial describes, how to get the number of distinct values in DAX if you you need multiple columns to recognize the uniqueness.
So for example here, for Monday, we´d like to see the value 3. There are 4 items for Monday, but the first and second row have the same color and size - so they have to be calculated as one.
Number of distinct values by one column is a piece of cake - you can create a new measure by DISTINCTCOUNT.
But if there are multiple columns to consider?
One of the options is to use COUNTROWS and GROUPBY together. At first GROUPBY merges the table according two columns, and then COUNTROWS calculates how many rows remained.
- Unique values = COUNTROWS(GROUPBY(Table1;Table1[T-shirt color];Table1[T-shirt size]))
Then the measure is used in some visual: