CALCULATE, CALCULATETABLE - DAX Guide

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

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

  • @peterbogdanovich4043
    @peterbogdanovich4043 3 ปีที่แล้ว +5

    Finally all the secrets of Calculate in one place, Bravo!

  • @esmaelawad1369
    @esmaelawad1369 2 ปีที่แล้ว +3

    I love this man what a great explanation
    but I surely love to hear him say FILTER CONETEXTA

  • @gourisankart6348
    @gourisankart6348 3 ปีที่แล้ว +2

    Never missing the videos now a days to watch it to gain knowledge. Appreciate your effort sir.

  • @NottoriousGG
    @NottoriousGG 2 ปีที่แล้ว +1

    This is what mastery sounds like. Thank you

  • @bipower6915
    @bipower6915 3 ปีที่แล้ว +1

    A very good summary over CALCULATE

  • @qaiserelahi122
    @qaiserelahi122 ปีที่แล้ว +1

    Dear Marco, Thanks for sharing your knowledge and expertise with us. Please help me solve one question if I want to find out the comparison of sales of current month v/s last month to find out who my new customers and who are the customers who didn't purchase this month from the sales table.

  • @princewable6854
    @princewable6854 6 หลายเดือนก่อน +1

    Hi, Alberto. Great video. I just have a request..Can you please provide the list of global & local modifiers used in CALCULATE function?

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

      They are listed on dax.guide/calculate/ in the Remarks section.

    • @princewable6854
      @princewable6854 6 หลายเดือนก่อน

      @@SQLBI Yes, they are listed there but it is not clearly mentioned which are local modifiers & which are global modifiers or different conditions to use in both cases.

  • @ikar2k
    @ikar2k ปีที่แล้ว +1

    Great video! Thank you for comprehensive explanation 👍❤️

  • @nebula12able
    @nebula12able 3 ปีที่แล้ว +1

    what i have seen ? Brilliant... like found the path to enlightenment.. wow!

  • @shailendrarajput4565
    @shailendrarajput4565 3 ปีที่แล้ว +1

    Very good summary video indeed,specially order of execution section , thank u so much ....all clear but a request , can we have one visual section with example on order of execution the way you have visually explained in arbitrary shaped filter video ...it will be really helpful for all

    • @SQLBI
      @SQLBI  3 ปีที่แล้ว

      It's too complex for a chart, you can find the list here: dax.guide/calculate

  • @lbarbyery
    @lbarbyery 3 ปีที่แล้ว +1

    Thanks to share all details about CALCULATE func. This is the fist time that a see se sequance o execution and I have a question. Why the evaluation are separeted of application of filters?

  • @DevilGoncalo
    @DevilGoncalo 3 ปีที่แล้ว +3

    Thank you for the videos, you and Marco are excellent teachers! This video helped me a lot!

  • @krellerp
    @krellerp 2 ปีที่แล้ว +1

    I love you Mr. Ferrari

  • @AgulloBernat
    @AgulloBernat 3 ปีที่แล้ว +2

    Thank you so much for this video. When applying a simple filter, CALCULATETABLE is the same as FILTER? As intermediate step on a calculated table I've had some issues with CALCULATETABLE that disappeared using FILTER

    • @SQLBI
      @SQLBI  3 ปีที่แล้ว +1

      They both returns a table, but FILTER iterates with a row context, whereas CALCULATETABLE does not - the semantics is different.

    • @AgulloBernat
      @AgulloBernat 3 ปีที่แล้ว

      @@SQLBI but then to apply a simple filter column from the same table they should be equivalent, right? I wonder what the issue was then.

    • @SQLBI
      @SQLBI  3 ปีที่แล้ว +1

      Please, can you clarify the question? I don't understand the reference.

    • @AgulloBernat
      @AgulloBernat 3 ปีที่แล้ว

      These two expressions when used to initialize a variable should always behave the same? dax.do/Hslp0K9WqQHLu2/

    • @AgulloBernat
      @AgulloBernat 3 ปีที่แล้ว

      I had an issue using CALCULATETABLE that disappeared when I used FILTER but don't have it in a model I can share, just checking if at least in theory they should behave the same or not.

  • @MatthiasK-qp9bf
    @MatthiasK-qp9bf 3 ปีที่แล้ว +1

    totally logical and very well presented :-) thx for this video

  • @SandipanSarkar-c8v
    @SandipanSarkar-c8v 3 หลายเดือนก่อน

    finished WATCHING

  • @Tommietusindbuks
    @Tommietusindbuks ปีที่แล้ว

    Hi
    when do I know if the result is a scaled value or a table?
    Thanks
    /Thomas

    • @SQLBI
      @SQLBI  ปีที่แล้ว

      A scalar value is a single string or number, a table may have more rows and columns - check the return type of the function used on dax.guide

  • @FredBagola
    @FredBagola 3 ปีที่แล้ว +4

    Hello Alberto, how are you? Great video, as always. Congratulations! I was left with a doubt: you said that every measure has a CALCULATE and also said about the order of evaluation of CALCULATE's arguments. Why in a row context do I get different results using a ready measure than writing CALCULATE directly? Example:
    DEFINE
    MEASURE Sales[# Color] =
    CALCULATE(
    COUNTROWS(VALUES(Product[Color])),
    VALUES(Product[Color])
    )
    EVALUATE
    ADDCOLUMNS(
    VALUES(Product[Color]),
    "@Calculate",
    CALCULATE ( COUNTROWS ( VALUES ( Product[Color] ) ), VALUES( Product[Color] ) ),
    "@[Measure]",
    [# Color]
    )

    • @francescobergamaschi800
      @francescobergamaschi800 3 ปีที่แล้ว +1

      With ready measure context transition steps in before the CALCULATE expression is evaluated

    • @FredBagola
      @FredBagola 3 ปีที่แล้ว

      @@francescobergamaschi800 Could you explain it better?

  • @nigeltufnel4031
    @nigeltufnel4031 3 ปีที่แล้ว +1

    Gonna get picky here. Can you add the [year] to the output table?
    Otherwise, always enjoy your content!

  • @odeddror8916
    @odeddror8916 2 ปีที่แล้ว

    Is there any way you can show in your video what is after the evaluate line or if you can drop this example for download? please

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว

      You can try the examples on dax.do starting from the related page on DAX Guide: dax.guide/calculate

    • @odeddror8916
      @odeddror8916 2 ปีที่แล้ว

      @@SQLBI Thank you

  • @engvictorfarias
    @engvictorfarias 3 ปีที่แล้ว +1

    Amazing, thanks.✍📚🧡

  • @leonardobrondani924
    @leonardobrondani924 3 ปีที่แล้ว +1

    Excelente explicación!! muchas gracias

  • @syedhabeeb6152
    @syedhabeeb6152 3 ปีที่แล้ว

    How to create a dax measure where individual rows it should calculate ratio and total should be sum of all the records visible ??

    • @shahidtab
      @shahidtab 2 ปีที่แล้ว

      Use VAR in your measure or Earlier Function to compare single row and use ALL function to remove filter on the table to keep your denominator same in all the rows.

  • @bandaralqahtani4356
    @bandaralqahtani4356 2 ปีที่แล้ว

    Hi Alberto l,
    What is the porpuse of "Calculate table" if we can do the same work with "Filter" function?

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว

      It performs a context transition and applies a filter context to the entire expression. It is useful in more complex expression, or when you want to remove filters. See examples here: www.sqlbi.com/articles/filtering-the-top-products-alongside-the-other-products-in-power-bi/

    • @shahidtab
      @shahidtab 2 ปีที่แล้ว

      If you use more than one boolean condition then using Calculate Table is the right choice instead of Filter.

  • @frankgovers8420
    @frankgovers8420 3 ปีที่แล้ว

    Hi, great. Do you think that calculatetable is better to use then the FILTER argument??

    • @SQLBI
      @SQLBI  3 ปีที่แล้ว +3

      They have different semantics. You should use CALCULATETABLE to apply filters, whereas FILTER is required whenever you have to filter a table based on the result of a measure (you need a row context that only FILTER can generate).

    • @frankgovers8420
      @frankgovers8420 3 ปีที่แล้ว +1

      Thanks for the answer guys, this ia what I allways tell to my students!!

  • @huyhoangnguyen7465
    @huyhoangnguyen7465 3 ปีที่แล้ว

    Where can I dowload this file????

    • @SQLBI
      @SQLBI  3 ปีที่แล้ว

      You can try the code online at dax.do or visit the dax.guide website - you can try all the examples from there.

    • @huyhoangnguyen7465
      @huyhoangnguyen7465 3 ปีที่แล้ว

      @@SQLBI I tried. Thank you

  • @3danim8r1
    @3danim8r1 2 ปีที่แล้ว +1

    Great minds....

  • @Everyonelovesyou
    @Everyonelovesyou 3 ปีที่แล้ว +1

    Calculatable in just 5sec........Wao

  • @pbihari0214
    @pbihari0214 3 ปีที่แล้ว +1

    thank you

  • @diegomex85
    @diegomex85 3 ปีที่แล้ว +1

    Ciao friends?
    haha Ty guys =)

  • @reynaldomalave
    @reynaldomalave 3 ปีที่แล้ว +1

    Thanks!!

  • @picious
    @picious 3 ปีที่แล้ว +1

    no "ciao friends" ? :)

    • @SQLBI
      @SQLBI  3 ปีที่แล้ว

      DAX Guide videos must be short!

  • @baharsh364
    @baharsh364 2 ปีที่แล้ว

    It is still complicated!

  • @jfelipevb
    @jfelipevb 10 หลายเดือนก่อน

    This is hard to understand

  • @tanaysontakke1200
    @tanaysontakke1200 2 ปีที่แล้ว

    Great explanation! I nearly understood the whole thing. However, there is still one little confusion around the context in which the explicit filter arguments are EVALUATED....this is after having gone through the steps on dax.guide website and then listening to your explanation here.
    In dax.guide website, it says that the EVALUATION of explicit filter arguments in CALCULATE, itself happens within the original evaluation context (original row context + original filter context) in Step 1. Then in Step 5 line 5, the evaluation of explicit filter arguments is mentioned again, but this time it says, within original filter context instead of original evaluation context. Then in your explanation here, it seems as though the explicit filter arguments are evaluated by just converting the condition into a table of value/s without any reference to an outer/original context. This created a little confusion for me.
    To summarize, I guess my query is.....Are the explicit filter arguments in CALCULATE themselves EVALUATED within the original evaluation context, or original filter context, or no outer/original context at all?

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว

      They are evaluated in the original evaluation context (including filter/row context).

  • @Wzxxx
    @Wzxxx 2 ปีที่แล้ว

    I wish it would be explained in power bi itself not a dax studio. For a beginner who is really frustrated with all these counter intuitive concepts adding dax studio with all strange things around is not a good idea.

    • @SQLBI
      @SQLBI  2 ปีที่แล้ว

      These videos are related to dax.guide, which is a guide to DAX functions, and they are not intended as a tutorial about the language.
      Please, follow this guide to move the first steps into DAX - most of the resources for beginners are free, in particular the Introducing DAX uses Power BI Desktop as user interface: www.sqlbi.com/guides/dax/

    • @Wzxxx
      @Wzxxx 2 ปีที่แล้ว +1

      @@SQLBI Thank You for the answer. I am studying the ultimate Dax book. Well I did learn Photoshop, did learn a lot of 3D graphics which was pretty hard, but DAX…it is so counter intuitive and frustrating for a beginner. A road through hell to get some pretty basic results in terms of mathematics.