DAX Fridays! #8: CALCULATE (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2016
  • The calculate function is the most useful measure available in DAX. Let's go through how it works in this part 2!
    Calculate Part 1: • DAX Fridays! #5: CALCU...
    Download Power BI file:curbal.com/blog/glossary/calc...
    PREVIOUS VIDEO: • DAX Fridays! #7: ALL, ...
    NEXT VIDEO: • DAX Fridays! #9: RANKX...
    Looking for a download file? Go to our Download Center: curbal.com/donwload-center
    SUBSCRIBE to learn more about Power and Excel BI!
    / @curbalen
    Our PLAYLISTS:
    - Join our DAX Fridays! Series: goo.gl/FtUWUX
    - Power BI dashboards for beginners: goo.gl/9YzyDP
    - Power BI Tips & Tricks: goo.gl/H6kUbP
    - Power Bi and Google Analytics: goo.gl/ZNsY8l
    ABOUT CURBAL:
    Website: www.curbal.com
    Contact us: www.curbal.com/contact
    QUESTIONS? COMMENTS? SUGGESTIONS? You’ll find me here:
    ► Twitter: @curbalen, @ruthpozuelo
    ► Google +: goo.gl/rvIBDP
    ► Facebook: goo.gl/bME2sB
    ► Linkedin: goo.gl/3VW6Ky
    #DAXFRIDAYS #CURBAL #DAX #POWERBI #MVP

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

  • @shashindulakshitha3789
    @shashindulakshitha3789 7 ปีที่แล้ว +14

    Thank you very much Curbal. Your channel is one of the best channels for someone to learn on PowerBI and DAX. Hoping to see your channel with more awesome videos.

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

      +shashindu lakshitha Many thanks for the comment, I really appreciate it!
      /Ruth

  • @MichaelBrown-lw9kz
    @MichaelBrown-lw9kz 3 ปีที่แล้ว +1

    Excellent, I have been studying the the CALCULATE function all week and you validated my understanding of it. Thank you so much

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

    Thank you very much, with videos 5,6 and 8 of the series "DAX Fridays!" are perfect.
    You're great!
    Thank you, thank you and thank you!

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Gustavo Bueno You welcome Gustavo!! Really happy to help 😀,
      /Ruth

  • @1989Bismillah
    @1989Bismillah 5 ปีที่แล้ว +4

    Great videos, I am building up my DAX knowledge thanks to these. Thank you for continuing this series!

    • @CurbalEN
      @CurbalEN  5 ปีที่แล้ว

      My pleasure and glad they are useful :)

  • @yugandharb4461
    @yugandharb4461 4 ปีที่แล้ว

    Million Thanks... You saved my time and hard analysis. Your videos are meaningful. Thanks.👍👍

  • @davidr.7904
    @davidr.7904 4 ปีที่แล้ว

    Hola Ruth! I love your constant ads for Queso Cabrales :-D (and your videos). Thanks for your work!

    • @CurbalEN
      @CurbalEN  4 ปีที่แล้ว

      They should sponsor me right?
      /Ruth

  • @tymothylim6550
    @tymothylim6550 4 ปีที่แล้ว

    Hello! Thank you for another video :) This video was really helpful. I like how you used Dax Studio to show us the table produced by Filter(). Thank you again for the help!

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

    Thank You! It's amazing! You've helped me a lot!

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Mariusz Nowakowski You welcome!!! Really glad it helped you :)
      /Ruth

  • @vijaypalmanit
    @vijaypalmanit 5 ปีที่แล้ว

    Thank you so much, finally I am able to understand both calculated and filter.

    • @CurbalEN
      @CurbalEN  5 ปีที่แล้ว

      Music to my ears!!!
      /Ruth

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

    Hola Ruth!!... Muchas gracias, excelente explicación.

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Norberto Vera Reatiga Muchas gracias Norberto!

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

    Hi, your videos are great. I am learning a lot from them and on my pace .

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

      Glad to hear!

  • @eriol33
    @eriol33 5 ปีที่แล้ว

    this is a very good introduction video. I have been trying to understand calculate for a while. I am going to try this on my work soon.

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

      Thanks and I hope it works for you in practice :)
      /Ruth

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

    Thanks a ton for such useful videos :)

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

    Excellent video.. very helpful.. like the way you make things look simple :)

    • @CurbalEN
      @CurbalEN  5 ปีที่แล้ว

      Thanks !
      /Ruth

  • @deepakkanade5041
    @deepakkanade5041 5 ปีที่แล้ว

    Hey Ruth. Both the parts of Calculate() are just WOW !!. Your way of explanation is very simplistic. I could very easily understand all the functions from #2 through #8 and could implement it in my test models, as the test data I am using is different from yours. Looking forward to going through all the further videos. These all will be equally elaborate and educative, I am sure. Thanks a lot !! _/\_

    • @CurbalEN
      @CurbalEN  5 ปีที่แล้ว

      Thanks! And I hope you enjoy my other videos too!
      /Ruth

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

    Excellent channel congratulations CURBAL :)

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +johan Hernan Sanchez Villano Thanks Johan! Glad you like it and have a great weekend :)
      /Ruth

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

    Great session very useful I managed to resolve the issue.

    • @CurbalEN
      @CurbalEN  5 ปีที่แล้ว

      Glad it helped! /Ruth

  • @Rafian1924
    @Rafian1924 4 ปีที่แล้ว

    Thanks a lot, you helped us to skill up and learn more. Could you please make a video on a dashboard which covers many important dax functions and help us to give the handson on real project?

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

    I would love to see Calculate #3 and #4...
    Perhaps how it helps with Filter vs ROW context, how it works with other measures and some advanced queries.

    • @CurbalEN
      @CurbalEN  6 ปีที่แล้ว

      +KeithA A yes, it is due now, isn’t it?I need to find the time to do it.
      /Ruth

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

    Excellent!

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

    Great, helped me solve a big problem!

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

      Lovely to hear!

  • @srinivastanniru6974
    @srinivastanniru6974 6 ปีที่แล้ว

    Excellent mam

  • @bobert13581
    @bobert13581 4 ปีที่แล้ว

    Nice deep dive

    • @CurbalEN
      @CurbalEN  4 ปีที่แล้ว

      Thanks!
      /Ruth

  • @GagandeepSingh-db8eh
    @GagandeepSingh-db8eh 3 ปีที่แล้ว

    Hi Ruth, what it make any difference If I use keepfilters.

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

    hi ruth.. Im getting same type of values in cal with 2 cond and cal with filter

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

    Thanks for explaining why the Year filter still applied, but the ProductName didn't. Calculate is pretty cool overall because it allows you to use Filters :)

    • @CurbalEN
      @CurbalEN  4 ปีที่แล้ว

      Agree :)

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

    The video is very helpful to understand the basics of the CALCULATE function but I'd like to see more specific real-world examples of how you'd use it. In other words, what would be some analysis that you can only do with the calculate function?

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +narianu0 Hi narianu, absolutely. You will see in future videos more uses of the calculate function. Stay tuned!
      /Ruth

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

    The video is great, do you have any course about DAX formula?

  • @Dipakbohora
    @Dipakbohora 4 ปีที่แล้ว

    To filter the report by calendar, is it necessary to have calendar in separate sheets or we can filter it from single sheet? I mean If I want to view the report by Year/Months, is it necessary to have the calendar in separate sheet or we can filter it from the same sheet where Sales Figure & Calendar are available in the same sheet?

  • @walidkhlil2872
    @walidkhlil2872 4 ปีที่แล้ว

    i hope for you health and wellness

    • @CurbalEN
      @CurbalEN  4 ปีที่แล้ว

      Thanks Walid, same to and your family!
      /Ruth

  • @jahangiralam2946
    @jahangiralam2946 4 ปีที่แล้ว

    Great

  • @ernestogonzalez6868
    @ernestogonzalez6868 7 ปีที่แล้ว

    hola, como se calcula el importe total de cada pedido teniendo en cuenta tambien el precio del flete (Orders.Freight)?
    Gracias

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

    I'm watching this 11:42 PM, and I can't really wrap my head around the FILTER function used as [filter] argument of the CALCULATE function. Does the behavior have anything to do with the relationship between FilteredProductsTable and Order_Detail?

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

    where can we find the files used in the video

  • @yiubili1
    @yiubili1 4 ปีที่แล้ว

    that topics is very very complicated, despite it is quite clear with the table provide, but i am sure that i still cannot understand it quite well...maybe only understand 40% or less....Anyway, thanks for your video, at least i got sth that i could refer to, when i meet the filter and calculate issue next time...

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

    Super

    • @CurbalEN
      @CurbalEN  6 ปีที่แล้ว

      Excellent :)
      /Ruth

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

    hi mam,how to calculate last 12 month LTM in dax please help me out

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

    How we do Filter with dynamic criteria

  • @suvadipkundu152
    @suvadipkundu152 5 ปีที่แล้ว

    Hi Ruth,
    I have come across a scenario where DATEADD function has been used within Calculate (as a filter of sorts) to arrive at past period values (e.g. returns)... the syntax goes as below
    Prev_mnth_retrun_Qty = CALCULATE(AW_Returns[Return_qty],DATEADD(AW_Calendar_Lookup[start of month],-1,MONTH))
    When I use this measure against start of month (a column in AW_Calendar_Lookup table created in the ETL stage). The measure dutifully shows the cumulative returns for the past month against each start of month row context.
    My challenge is that I am unable to follow thru' the calculation order/filter context, if you can explain or guide me to a resource which can help me clarify my doubts, I will be much obliged.
    Cheers and a belated wish for a great year ahead.
    suvadip

    • @CurbalEN
      @CurbalEN  5 ปีที่แล้ว

      Hi! Could you post your question on the power bi community? It is a great place for support!
      /Ruth

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

    ALL THE CHEESES! I'm starving now...

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

      😂😂 The northwind dataset will do that to ya!

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

    Could you provide Calculate 2 curbal .xlsx. thanks from cabrales area

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +David Fombella Pombal Haciendo patria!!
      You can access the dataset yourself for free. Here is how:
      Northwind dataset: th-cam.com/video/k3NMIlLffrU/w-d-xo.html
      /Ruth

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

    I am trying to calculate if the text contains some characters. any trick to do this? Thank you for your videos they are quite helpful! :)

    • @CurbalEN
      @CurbalEN  6 ปีที่แล้ว

      Have you tried SEARCH or FIND:
      curbal.com/blog/glossary/search-dax
      Or
      curbal.com/blog/glossary/find-dax
      /Ruth

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

    Thanks for this great tutorial on Calculate. I need some help as I'm very new to DAX. For example, I have 5 salesman, Salesman1, Salesman2 and so on. Each of them has sales by day. I need to get the cummulate sales by salesman as of today. I'm doing something wrong. I can´t get the correct result. My measure is:
    fCummSales = CALCULATE(sum('Table1 (2)'[Sales]),FILTER(ALL('Table1 (2)'), 'Table1 (2)'[Salesman]]))
    Table Name is "Table1(2)"
    Sales column is "Sales"
    Salesman name column is "Salesman"
    Thanks in advance.
    Reggie.

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Reggie Revello Hi Reggie,
      Please check this video, i think it will help you:
      m.th-cam.com/video/d-Jk1j2G3nw/w-d-xo.html
      /Ruth

  • @hnp250
    @hnp250 4 ปีที่แล้ว

    Excellent video!!
    Question for Curbal. Lately I have discovered that I can use CALCULATE also in this manner and it works: CALCULATE( Table1[ Measure1 ] , Table2 , Table3 ...)
    Could you please explain this behavior?
    Thank you very much!

    • @CurbalEN
      @CurbalEN  4 ปีที่แล้ว

      Hi!
      You can always write table[measure], but it is a best practice not to do it so it doesn’t get confused with a calculated column.
      Hope this explains it :)
      /Ruth

    • @hnp250
      @hnp250 4 ปีที่แล้ว

      Hi Ruth. Thanks for the answer! My example wasn`t very clear i guess ha ha...
      Actually what i was trying to show is this: CALCULATE( [Measure] , Table ) or CALCULATE( [Measure] , Table1 , Table2 )
      where a whole Table or Tables are used as filter arguments instead of using columns conditions.
      I'm comfused about what CALCULATE does when i use just a Table as a filter condition.
      Thank you very much!

  • @vakfunnyfactstelugu9531
    @vakfunnyfactstelugu9531 4 ปีที่แล้ว

    Why the data was showing correctly for Year wise

  • @rolandkc
    @rolandkc 7 ปีที่แล้ว

    This video is definitely more challenging than the first one on CALCULATE. I have a no of questions which I will put in separate comments

    • @rolandkc
      @rolandkc 7 ปีที่แล้ว

      In CAL w 2 cond, we have 7301+6912=14213 and 3466+4384=7850 but results show 7849, can you, in DAX, use rounding so that we do not have rounding issues on reports?

    • @rolandkc
      @rolandkc 7 ปีที่แล้ว

      Quest 2: is it possible in the example with 3 measures - CAL w cond, CAL w 2cond, CAL w ALL 'filter' [without using the function FILTER] - to show subtotals for year 1997 and 1998?

    • @rolandkc
      @rolandkc 7 ปีที่แล้ว

      Quest 3: with the measure fCAL w ALL FILTER [this time with the FILTER function], I do not understand that you have used ALL FILTER when you are referencing 2 products [2 cheeses]. This is confusing for me. Can you elaborate in a different way so that I can understand this. For me, intuitively when you refer to ALL FILTER, it means do NOT apply filter at ALL, by this I understand that there is NO filter being applied and that therefore ALL products are included in the calculation.

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Roland Kc Yes, you have ROUND() , ROUNDUP and ROUNDDOWN() I think, pulling from memory..
      /Ruth

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Roland Kc Hi again, the CALCULATE vídeos where one the first videos I did. I have been asked since then to make another one explaining more about it, so I will compile all your questions and make a new video as soon as time allows.
      You are going to do well with Power BI 😄
      /Ruth

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

    Hi Ruth, Im kind of new in DAX, what does it means the 2 "||" in you calculate filter ?
    Cheers.

  • @dineshvenkat8746
    @dineshvenkat8746 5 ปีที่แล้ว

    any update pls?

  • @dineshvenkat8746
    @dineshvenkat8746 5 ปีที่แล้ว

    hi i need urgent help on to create simple profit and loss table in power bi please

    • @dineshvenkat8746
      @dineshvenkat8746 5 ปีที่แล้ว

      kindly can you help me to create simple profit and loss calculation by row wise in power bi and data is exported from excel

  • @TheJoel8787
    @TheJoel8787 7 ปีที่แล้ว

    hi - can I get the .pbix file for this and the other vids you have created ? thank you.

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      Hi Joel,
      I have now added the files for download on the description box, thanks for letting me know. If you find other videos with missing files, let me know,
      /Ruth

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

      thank you !

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +joel .b Thanks to you for watching! :)
      /Ruth

  • @nupursolanki9931
    @nupursolanki9931 7 ปีที่แล้ว

    hello,
    i just want to know about rankx and topn in details

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      Hi Nums,
      I have two videos about rank here:
      th-cam.com/video/SsZseKOgrWQ/w-d-xo.html
      topn with rank:
      th-cam.com/video/z2qzJVeYhTY/w-d-xo.html
      Hope this helps,
      /Ruth

    • @nupursolanki9931
      @nupursolanki9931 7 ปีที่แล้ว

      i have seen this video i have one query on cllicking top10 we get top 10 records and other are blank ,can i get only top10 record by clicking top10

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      +Nums Solanki You mean that you have blanks in your query and they appear in your top 10 list ?
      /Ruth

    • @nupursolanki9931
      @nupursolanki9931 7 ปีที่แล้ว

      No, i mean that on clicking top10 we get 10 record by rank and other rank sales are blank i dnt want that blank record when i click on top10 just top10 rank sales etc..

    • @CurbalEN
      @CurbalEN  7 ปีที่แล้ว

      To be able to help you, I need a sample file. Please send me an email here: curbal.com/contact so I can give you my email address.
      /Ruth

  • @260sai
    @260sai 4 ปีที่แล้ว

    hai
    Total sales = SUMX(Purchase,[Price]*[Quantity])
    Sales for product = CALCULATE(SUMX(Purchase,[Price]*[Quantity]))
    why i am getting different results even though formula looks same.
    please don't answer like please post on power bi blog

    • @HarshNathani
      @HarshNathani 4 ปีที่แล้ว

      Not sure why you are getting different values. Try the below measures in the pbix file provided. You should get the same values when you drag ProductName from Product Table and these 2 below measures.
      Total_Sales_Cal = CALCULATE(SUMX(Order_Details, Order_Details[UnitPrice]*(1-Order_Details[Discount])*Order_Details[Quantity]))
      Total_Sale_SumX = SUMX(Order_Details, Order_Details[UnitPrice]*(1-Order_Details[Discount])*Order_Details[Quantity])

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

    Measure 3 = CALCULATE(COUNTA(FactAttendanceDaily[AttendanceDate].[Date]),FILTER(FactAttendanceDaily,FactAttendanceDaily[SchoolYear]="2017"))
    This is not working even not showing any error! :(

    • @CurbalEN
      @CurbalEN  6 ปีที่แล้ว

      Post in the power bi community with sample data so you can get specific help!
      /Ruth

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

    "You will feel hungry watching this video"

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

      Say cheeeeeese 😂

  • @SSM_33
    @SSM_33 4 ปีที่แล้ว

    you will get hungry watching this video hahahaahahahahahaha

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

      😂😂😂

  • @user-nb3pi3et9p
    @user-nb3pi3et9p 7 หลายเดือนก่อน

    Your voice is not clear and too slow

    • @CurbalEN
      @CurbalEN  7 หลายเดือนก่อน

      Yeah! Was doing this videos at midnight back then. Hopefully the learnings are still there!

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

    Bad example

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

      Roger that!