KEEPFILTERS - DAX Guide

Поділитися
Вставка
  • Опубліковано 28 вер 2024
  • KEEPFILTERS: Changes the CALCULATE and CALCULATETABLE function filtering semantics.
    dax.guide/keep...
    This video is part of DAX Guide, the online guide to all the DAX functions, with links to related content and compatibility matrix with all the versions of Power BI, Azure Analysis Services (AAS), SQL Server Analysis Services (SSAS), SQL Server Data Tools (SSDT), and Power Pivot for Excel.

    How to learn DAX: www.sqlbi.com/...
    The definitive guide to DAX: www.sqlbi.com/...
    Code, run, and share DAX with DAX.do: dax.do/?aff=yt

    #dax #powerbi #ssas #tabular #analysisservices #powerpivot

КОМЕНТАРІ • 12

  • @robrayborn1349
    @robrayborn1349 3 роки тому +4

    That one hurt my head. But I think I understand.

  • @chiquita683
    @chiquita683 3 роки тому +2

    Still confused on why the White is 2,368,479 and Red is 2,288,307. I would think that if these did not recognize the filters of White and Red they would be the same number because they'd add up the values of both for 2007 and 2008. Plus if we add the salesx keep of both neither of these SalesX numbers match. Would have been useful to see the original table first to follow but I think I get the general idea.

  • @pbihari0214
    @pbihari0214 3 роки тому +1

    thank you

  • @aussiedragon8916
    @aussiedragon8916 2 роки тому

    What would be the result if you used the filter table function?

    • @SQLBI
      @SQLBI  2 роки тому

      You can use KEEPFILTERS only as a CALCULATE argument.

    • @aussiedragon8916
      @aussiedragon8916 2 роки тому

      ​@@SQLBI Hi Guys, thanks for replying. My apologies, I didn't explain correctly what I am trying to figure out. :-)
      Within the calculate argument, I'm trying to understand the different effects of using modifiers and filters. For instance,:-
      (A)
      CALCULATE (
      [Sales Amount],
      Product[Color] = "White"
      )
      being the same as:-
      (B) CALCULATE (
      [Sales Amount],
      Filter (
      All(Product),
      Product[Color] = "White"
      )
      )
      So therefore, is
      (C) CALCULATE (
      [Sales Amount],
      KEEPFILTERS ( Product[Color] = "White" )
      )
      the same as:
      (D) CALCULATE (
      [Sales Amount],
      Filter (
      Product,
      Product[Color] = "White"
      )
      )
      One other thing, when I use colour as the row, (A) and (B) it will give you the same sales amount value, however, if you change row to brand, (A) and (B) do not return the same values, so in effect, they are not functioning as the same ?? Why would that be so?

  • @danielmudie605
    @danielmudie605 3 роки тому +2

    Perfect, you answered my question in the first 35 seconds! So much better than the Microsoft article!

  • @shailendranr2756
    @shailendranr2756 3 роки тому +2

    Appreciate your time and effort in explaining this to us, I became big fan of you in short time

  • @baskis69
    @baskis69 3 роки тому +2

    Con questi video, possiamo iniziare a vedere la luce. Grazie mille¡¡¡¡

  • @Bharath_PBI
    @Bharath_PBI 3 роки тому +2

    Didn't know about using it in an iterator function. Good to know. Thank you 👍

  • @sue_bayes
    @sue_bayes 3 роки тому +1

    Ahhh I think, so this is a way of working out the sales amount on Red CY 2008 and on White CY 2007 because there is no common year or colour hence arbitrary shaped set.

  • @PrettyEpicGaming
    @PrettyEpicGaming 2 роки тому +1

    Basically the KEEPFILTER formula will do an intersection operation with the inner filter context and the outer filter context.