Forum Discussion
PBI Calculate Function - keep the contextual filters
- 6 years ago
farhandsome
For the filter you use inside calculate function, wrap it in KEEPFILTERS, it will create and condition.
https://docs.microsoft.com/en-us/dax/keepfilters-function-dax
Example:OnlyRed_KeepfiltersAll := CALCULATE ( [Sales Amount], KEEPFILTERS ( FILTER ( ALL ( Products[Color] ), Products[Color] = "Red" ) ) )________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
farhandsome
Yes, KEEPFILTERS will not overwrite, rather it adds to the existing filter and sort of itersects.
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
farhandsome
Hope the explanation was clear? If so, accept the reply as a solution?
For further on this topic, refer to :https://www.sqlbi.com/articles/using-keepfilters-in-dax/
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂