Filter columns, not tables, in DAX

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 57

  • @stuartsaint4581
    @stuartsaint4581 4 หลายเดือนก่อน +13

    "Whenever you reference a table in DAX, it is always the expanded table." I see this a lot when somebody starts learning DAX coming from an Excel background, it's a hurdle that people don't necessarily have if you come from a SQL background where this concept is more familar. If you are watching this and feel frustrated to have not known this earlier, remember that you were smart enough to get this far in the first place!

    • @leppyr64
      @leppyr64 3 หลายเดือนก่อน

      This 100%

  • @phungboston
    @phungboston 3 หลายเดือนก่อน +2

    Thank you so much for providing such valuable free content. After using Power BI for six months, I've gained a solid understanding of the concepts you've taught. Your lessons have been instrumental in my professional growth as a power bi data analyst

  • @jonoakdale
    @jonoakdale 4 หลายเดือนก่อน +3

    I've been waiting for an in depth explanation around this golden rule for a while; thank you!!

  • @akshayebenezar
    @akshayebenezar 4 หลายเดือนก่อน +11

    Do you have a video/ playlist with all the golden rules n best practices. Love your work!! ❤

  • @capitaldea
    @capitaldea 3 หลายเดือนก่อน +1

    I watched this early in the morning. Now I don't need my morning coffee. This blew my mind!

  • @Nalaka-Wanniarachchi
    @Nalaka-Wanniarachchi 4 หลายเดือนก่อน +1

    Another Fantastic one.Alberto & Marco always opens new horizons in DAX to think over.

  • @nishantkumar9570
    @nishantkumar9570 4 หลายเดือนก่อน +2

    Thanks so much for sharing the understanding about the difference in table and column filters and it's impact. Will definitely keep this in mind while writing measures.

  • @nevermore17011990
    @nevermore17011990 4 หลายเดือนก่อน +5

    if there is a nobel for DAX, this guy deserve it !

  • @workstuff5253
    @workstuff5253 4 หลายเดือนก่อน +1

    Counting with Alberto! Love it!!

  • @emersonlopez5310
    @emersonlopez5310 4 หลายเดือนก่อน +1

    Great video, thanks a lot. I got the same result by modifying the "Sales Amount" and "Receipts Amount" measures because in sumx I used filtered tables for multiplications greater than or equal to 500, however I am doing a double iteration in each case.

  • @mwaltercpa
    @mwaltercpa 3 หลายเดือนก่อน +1

    Thanks for this insight on expanded tables.

  • @anilyadav-rt4sr
    @anilyadav-rt4sr 4 หลายเดือนก่อน +1

    Thanks Sir ji after a long time create a nice video

  • @gvitullib
    @gvitullib 4 หลายเดือนก่อน +1

    Thank you. A great article/video on this important golden rule!

  • @xyclos
    @xyclos 3 หลายเดือนก่อน +1

    Great explantion, Thanks!

  • @RobertoStaltari
    @RobertoStaltari 4 หลายเดือนก่อน +3

    SQLBI: Masters at work.

  • @nikakalichava8012
    @nikakalichava8012 4 หลายเดือนก่อน +1

    Thank you for sharing this. really insightful.

  • @brnnie
    @brnnie 3 หลายเดือนก่อน +1

    Thank you for sharing this ❤

  • @dutch-man
    @dutch-man 4 หลายเดือนก่อน +1

    Nice video as usual 😎👏

  • @rowanschoultz1022
    @rowanschoultz1022 3 หลายเดือนก่อน +1

    Alberto, you mentioned that this is one of the "golden rules of DAX". Do you have a compilation of these golden rules available anywhere? See you Sep 18th in Calgary.

  • @louiseshorten9389
    @louiseshorten9389 4 หลายเดือนก่อน +1

    I didn’t know about the golden rules. Thanks for this video! Just wondering, I assume you could add a Boolean flag as a Column which checks whether the relevant values >500 and then this could be the filter. How would this compare? Thank you

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน

      Yes, see this article for the fundamentals: www.sqlbi.com/articles/filter-arguments-in-calculate/

  • @fsanfo
    @fsanfo 4 หลายเดือนก่อน +1

    Thanks for sharing! I think it would be nice to have a video about when the use of filters in tables is unavoidable.

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน +4

      Never?

  • @gurvindersingharora5301
    @gurvindersingharora5301 3 หลายเดือนก่อน +1

    Please upload more dax videos related summarize and ADDCOLUMNS together usage

  • @lovlyhearts288
    @lovlyhearts288 3 หลายเดือนก่อน +1

    Nice explanation

  • @ajaaskelainen
    @ajaaskelainen 3 หลายเดือนก่อน +1

    Thank you!

  • @marcomapelli5953
    @marcomapelli5953 4 หลายเดือนก่อน

    Molto interessante!
    C'è un elenco di queste "regole fondamentali" da qualche parte?

  • @AlirezaEmamiFard
    @AlirezaEmamiFard 4 หลายเดือนก่อน +1

    Thanks, it's really useful

  • @stylianoschiotis5191
    @stylianoschiotis5191 4 หลายเดือนก่อน +1

    Excellent 👌

  • @lucasdenker3734
    @lucasdenker3734 3 หลายเดือนก่อน +1

    Why have you used KEEPFILTERS in the correct measure? I would just write as you did before without that function. It would be wrong to do so?

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน +1

      It's to keep the same semantics, even though it's not needed for the report used in the demo.

  • @gurvindersingharora5301
    @gurvindersingharora5301 3 หลายเดือนก่อน +1

    Hello Alberto Sir,
    A lot of people are creating Pareto Chart in Power Bi Using various techniques of DAX.
    What will be yours ?? Please Create a Video of it !! ❤

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน

      You have a full pattern here: www.daxpatterns.com/abc-classification/

  • @anoopdube9581
    @anoopdube9581 4 หลายเดือนก่อน +1

    Very insightful

  • @common_sense4753
    @common_sense4753 4 หลายเดือนก่อน +1

    @sqlbi thanks. I just got confused, though. I always thought that what you described as the column filter was ultimately converted by the engine to filter(all(sales), amount>=500)
    Now I’m confused :)

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน +1

      It is converted to a column filter, not to a table filter: www.sqlbi.com/articles/filter-arguments-in-calculate/

    • @Nalaka-Wanniarachchi
      @Nalaka-Wanniarachchi 3 หลายเดือนก่อน +1

      @@SQLBI Ah,That means FILTER(ALL(Sales[Quantity],Sales[Net Price]), Sales[Quantity] * Sales[Net Price] >= 500) etc..?

    • @gnico64
      @gnico64 3 หลายเดือนก่อน

      @@Nalaka-Wanniarachchimy question exactly! Need to try it on a model to make sure it works like this or not

  • @paulinafaryna6372
    @paulinafaryna6372 4 หลายเดือนก่อน +1

    This is brilliant

  • @mogarrett3045
    @mogarrett3045 4 หลายเดือนก่อน +1

    thank you

  • @attaurrahman1880
    @attaurrahman1880 4 หลายเดือนก่อน +1

    Thank you for Sir

  • @workstuff5253
    @workstuff5253 4 หลายเดือนก่อน +1

    Slightly off the topic (but still related). I suspect some of the reasons are based on requirements to enable a better demonstration, but is there an advantage to having DAX calculate the sales value (net price * quantity) over having the value calculated in an ETL process and having the value stored in the model as a further column.

    • @SQLBI
      @SQLBI  4 หลายเดือนก่อน

      Usually you save memory thanks to a better compression, unless you have billions (not millions) of rows, in which case the difference is negligible and the perf improvement of a single column is relevant (it is not with millions of rows).

  • @marcofestu
    @marcofestu 4 หลายเดือนก่อน +1

    The DAX magister

  • @PillsLifestyleReviews
    @PillsLifestyleReviews 4 หลายเดือนก่อน +1

    The screenshot perfectly describes me when DAXing...

  • @amitsatnalika5760
    @amitsatnalika5760 4 หลายเดือนก่อน

    this problem of intersecting expanded table arises bcz we have two fact tables here and we are using these two together inside a single calculate, we can use these in two separate calculate and add those measure............................................................................................ what if if we have only one fact table , there expanded tables helps , let say in case where we have a measure associated with a dimension table and we need to respect filter coming from other dimension table , in that case only table filter or expanded table is the rescue.

    • @SQLBI
      @SQLBI  4 หลายเดือนก่อน

      Normal filter propagation in that case doesn't require the expanded table. The example in the video is a simplification of a more complex real-world case scenario where table filters are applied on high-level measures, and down the hierarchy of nested measures in the calculation you could have a similar situation like the one described in the video, but in a more complex scenario where the presence of the issue is less obvious and much harder to investigate.

  • @mathew9665
    @mathew9665 3 หลายเดือนก่อน

    Interesting - how about a filter around a number of summarised columns like:
    VAR _FilteredWithoutFees =
    FILTER (
    SUMMARIZECOLUMNS (
    'Sales'[AdminFee],
    'Sales'[IsVoided],
    TransTypes[TransType]
    ),
    'Sales'[AdminFee]

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน

      The filter over columns in AND condition should be always split by column. Try to apply this filter to a CALCULATE with a non-additive measure (e.g. DISTINCTCOUNT, apply YTD, or use a bidirectional relationship) and you'll see the impact.

    • @mathew9665
      @mathew9665 3 หลายเดือนก่อน

      @@SQLBI Thank you kindly - I don't understand how to use filter columns then build it into an in memory table. - what would be the best method to use in this type of requirement

    • @SQLBI
      @SQLBI  3 หลายเดือนก่อน +1

      We suggest that you review the foundational concepts - use this free course to start: www.sqlbi.com/p/introducing-dax-video-course/

    • @mathew9665
      @mathew9665 3 หลายเดือนก่อน

      @@SQLBI Thank you after posting - I did a lot of testing of the basic calculate filter - it works and a lot quicker

  • @Superninja1211
    @Superninja1211 4 หลายเดือนก่อน +1

    Billion !!!... not Million !!!.... But other than that thanks. Very helpful!

  • @douglascory
    @douglascory 4 หลายเดือนก่อน +1

    I always found it weird when people used FILTER inside a calculate, like I always thought: There must be a reason they are using it, since calculate already filters
    Nope, turns out it was just wrong lol

  • @Milhouse77BS
    @Milhouse77BS 4 หลายเดือนก่อน +1

    Always interested when I hear “never”.

  • @frasermartens3976
    @frasermartens3976 3 หลายเดือนก่อน +1

    Honestly, I sometimes think Microsoft should just completely remove the ability to filter a table. What's even the point of having this unnecessary and clumsy function in the language at all? Is there some arcane use case that it needs to be kept to address?