Best practices for using KEEPFILTERS in DAX
HTML-код
- Опубликовано: 6 май 2024
- Best practices for deciding when to use (and when not to use) KEEPFILTERS in CALCULATE filter arguments.
Article and download: sql.bi/837707?aff=yt
How to learn DAX: www.sqlbi.com/guides/dax/?aff=yt
The definitive guide to DAX: www.sqlbi.com/books/the-defin... Наука
Excellent representation. Thanks for all your hard work to the BI community.
Thank you Marco
Excellent examples and explanation of the proper use of KEEPFILTERS. Thank you!!
I use KEEPFILTERS very often for accounting measures, thx for the deeper insights
Extremely useful content, as always!!
Briliant explenation!
Thank you Marco!
Omg! This is well explained. Thank you so much
Wow.Clear explanation...
like the new mark up pen. was helpful. thanks.
Very useful. Thank you very much.
Hey there,
For the new year sales use case - why would you define the measure specifically for a year?
Wouldn’t a dynamic measure make a lot more sense? As in simply filtering for December and January? This way you‘d get new years sales for all years that will ever come.
In the first example the wrong % of tendy colors seems more right for me, because it always calculates % of all trendy colors among chosen in slicer and no matter what those trendy colors are. In a measure with keepfilters user can hardly guess what values he sees in the table. Vice versa the second usecase in video is an excellent example of using keepfilters formula - to apply both filters at the same time.
Hi Marco.If we want a very simple cal like sales for product color red and show against a brand and I have slicer for color
Then which option is right
1) Filter(values(color),color=red)
2) color = Red
3) keepfilters( color= Red) and what is best between 1& 3 option
Sales for Red Products =
CALCULATE(
SUM(Sales[Amount]),
keepfilters(Products[Color] = "Red")
Ciao Marco!
In new year sales case you have used tuples, is there a way to feed tuples dynamically?
Any table expression that generate multiple columns, e.g. SUMMARIZE or CROSSJOIN
In USA, we'd use order of "red, white, and blue" :) because of our flag.