Forum Discussion
Keepfilters vs Filters
- 4 years ago
Alex_Hasan
I would suggest you use the 1st Measure "Green Sales":
Explanation: You have effectively used KEEPFILTER here to show sales only when Green colour is visible. The most important point is, only the Product [Colour] column is used but the in the second measure, you are referring to the full Product table within the Filter function which is not efficient, also it will have the unexpected effect of expanded table.
Hi Alex_Hasan
yes becuase the first one is actually
KEEPFILTERS ( FILTER(*Product, 'Product' [Color] = "green' ) )
where here KEEPFILTERS does nothing
- Alex_Hasan4 years ago
Helper II
Hi tamerj1 , your answer seems confusing to me. Could you please elaborate?
- tamerj14 years ago
Community Champion
Sorry for the in accurate explanation.
CALCULATE ( [Amount], "Product' [Color] = "green" ) is actually translated intoCALCULATE ( [Amount], FILTER ( ALL ( Product), 'Product' [Color] = "green" ))
Which returns the value of green in all cells.
this is because the filter context of each cell contains the coplete product table while when using only FILTER the filter context in each cell contains only the related color therefore the intersection is empty except for green.