Forum Discussion
TL5866
8 years agoFrequent Visitor
FILTERS() vs VALUES()
Hi, DAX has two functions that can be used as filter in CALCULATE: VALUES() and FILTERS(). Would anyone know how they really differ - apart from the fact that VALUES() also takes a table as para...
- 8 years ago
They have difference. FILTERS() will directly apply the column as filter into your calculation, which will ingore other filter. But for VALUES(), it just returns a table of single column with distinct values, which means it will take other filter as well. Please see my sample below:
Measure with VALUES = COUNTROWS(VALUES('Table'[YearMonth]))Measure with FILTERS = COUNTROWS(FILTERS('Table'[YearMonth]))Regards,
v-sihou-msft
8 years agoMicrosoft Employee
They have difference. FILTERS() will directly apply the column as filter into your calculation, which will ingore other filter. But for VALUES(), it just returns a table of single column with distinct values, which means it will take other filter as well. Please see my sample below:
Measure with VALUES = COUNTROWS(VALUES('Table'[YearMonth]))
Measure with FILTERS = COUNTROWS(FILTERS('Table'[YearMonth]))
Regards,