Consecutive days with no sales - Unplugged #18

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • Patrick LeBlanc from Guy in a Cube asked how to compute the number of consecutive days without sales. A good topic for a new unplugged video, with Patrick as a special guest!
    Read more about the "unplugged" format: www.sqlbi.com/...
    #unplugged

Комментарии • 94

  • @michelcesar85
    @michelcesar85 3 года назад +3

    Amazing Alberto imitating Patrick 🤣🤣🤣...exepcional video!

  • @obazeeghosa
    @obazeeghosa Год назад +1

    Simply Excellent! This is precision DAX Engineering

  • @PowerBIFerryTales
    @PowerBIFerryTales 3 года назад +15

    Brilliant intro and some very helpful DAX. Also, you could never be boring Alberto!

  • @JBartlett_DMU
    @JBartlett_DMU 3 года назад +7

    These crossover videos are priceless. I really get a kick out of watching you guys riffing on each other's "rituals" and "sacred words" from Primal Branding. Those are such powerful engagement techniques on their own, and you guys take it up several notches from there when you collaborate like this. Bravo.

  • @dhruvsingh9
    @dhruvsingh9 3 года назад +8

    Wonderful video.... The approach to the problem is very very nice ..we can see how you think and also it is a great learning to solve optimization problems ..it is like a jackpot video which solves all the problems in just 30 minutes .I can't believe Alberto Ferrari can act as well . 😂🤣... fantastic collaboration.. with Patrick.

  • @danielsiffredi8403
    @danielsiffredi8403 3 года назад +2

    you are clearly DaBoss! - amazing troubleshooting and explanation , step by step.

  • @MatthiasK-qp9bf
    @MatthiasK-qp9bf 3 года назад +3

    I wish I would have had a teacher like Alberto in my studies 25 years ago. So amazing! I hope I can pass on some of that to our new employees.

  • @giuliolaudani1153
    @giuliolaudani1153 3 года назад +2

    L'eroe di cui abbiamo bisogno, ma che non meritiamo!!
    Grazie sempre eccezionale!

  • @NirRobinson
    @NirRobinson 3 года назад +4

    Master piece.
    So much knowledge and adjustments to dax code in just several of minutes.
    10x!!!

  • @hlambert100
    @hlambert100 2 года назад +1

    Thank you very much, Two times you save my work with your amazing and complete videos.

  • @rick_.
    @rick_. 3 года назад +3

    Awesome, thank you! It is really helpful having you explain your thought process as you work through optimizing the code.

  • @drod96
    @drod96 3 года назад +2

    I have been literally working on this problem for the the last few weeks! Thank you!!!

  • @cptdeadeye2112
    @cptdeadeye2112 3 года назад +1

    Saved me again, while teaching me new things in the process.
    Greatly appreciated.

  • @bouseuxlatache4140
    @bouseuxlatache4140 2 года назад +1

    this was really cool blending together the american coolness and the italian class together

  • @Milhouse77BS
    @Milhouse77BS 3 года назад +1

    Nicely done. Watching someone work thru problems makes it easier to follow. And I feel smarter since I saw the REMOVEFILTER problem earlier than Alberto!

  • @salvatorescofano6756
    @salvatorescofano6756 3 года назад +2

    Congratulations Alberto, It was the best DaX class, which I attended, challenging

  • @EricaDyson
    @EricaDyson 3 года назад +1

    And I do like your videos.. you never ever ever disappoint. I am so grateful for all you do to help us lesser mortals.

  • @ailtontombia7050
    @ailtontombia7050 3 года назад +1

    I´m a huge fan, this Dax is going to be very helpful in creating Sales reports. Thank you very much. I have been improving my Dax Skills gradually thanks to Alberto and Marco

  • @sue_bayes
    @sue_bayes 3 года назад +2

    Fascinating how you broke down the problem into small steps and then how you used DAX and DAX Studio to build the measure and optimise it. Really helpful in how to problem solve and think in DAX.

  • @alexkim7270
    @alexkim7270 Год назад +1

    Oh my goodness! You guys doing such a good intro using each other's scripts! Haha!

  • @marshal115
    @marshal115 3 года назад +4

    What an amazing collaboration🤣

  • @franciscoclaudio4818
    @franciscoclaudio4818 3 года назад +2

    thank you so much!
    Brazilian greetings.

  • @erickknackstedt3131
    @erickknackstedt3131 3 года назад +2

    This intro was amazing! Great work.

  • @rerangelt
    @rerangelt 3 года назад +2

    Jajaja. This was a great intro. And a great video, as always.

  • @filip3783
    @filip3783 3 года назад +1

    Such a inspiring content for junior like me to see a pro at work in real time alongside code optimization. Keep up the good work :)

  • @sonetmollick4630
    @sonetmollick4630 3 года назад +1

    Thanks Alberto. You are the best :)

  • @alphatradingmethod1193
    @alphatradingmethod1193 3 года назад +3

    Wonderful!!! Just what I needed, and also, I’m working on the counting of sales dates against the same sales days count from last year. By the way, can you share where you bought your microphone!!!??? And the details of it….Please?? It looks not heavy at all!!!! Thank you Alberto and Patrick!!

    • @SQLBI
      @SQLBI  3 года назад

      You can find it here: www.sqlbi.com/blog/alberto/2021/02/14/on-my-recording-gear/

  • @chrissavop5985
    @chrissavop5985 3 года назад +2

    Another Excellent video, you make it looks so easy but it’s definitely not. Thank you

  • @MdShahidulIslamshafimbd
    @MdShahidulIslamshafimbd 3 года назад +2

    Love you guys. Really insightful

  • @workstuff5253
    @workstuff5253 3 года назад +1

    Love this crossover video style!!

  • @sane7263
    @sane7263 2 года назад +1

    As always best content❤, The crossOver was Lit.......suggestion: why not Hollywood Alberto?

  • @mjwj88
    @mjwj88 3 года назад +2

    This is really great stuff AND pretty much exactly opposite what I'm trying to accomplish. How do I change the DAX to count the days where there were sales? (My use case is counting how many consecutive days an employee worked ... to help us maintain compliance and ensure we aren't stressing our employees.)

  • @furk97
    @furk97 3 года назад +1

    It is getting better and better LOL.

  • @sebfledruide
    @sebfledruide 2 года назад +1

    Really helpful video. Thank you so much !
    Any idea on how I could get the latest value of the measure for each serie of period without sales ?

  • @wmfexcel
    @wmfexcel 3 года назад +2

    This is brilliant!
    From 4 seconds to half second add the prefix "Super" to "brilliant"! :)
    Although 4 seconds mean "forever" to Alberto, it means "super fast" to most users (in my company). 😁
    May I ask one question?
    For calculating the first date ever, why don't we remove filter to date table only? If we remove filters to every table, does it return the first date ever for all products instead of the color selected?
    Appreciate your advice.

    • @SQLBI
      @SQLBI  3 года назад +1

      You're right about removing the filters - clearly, it depends on your requirements.

    • @wmfexcel
      @wmfexcel 3 года назад +1

      @@SQLBI thank you so much for your prompt reply! 🙏🏻👍🏻

    • @alt-enter237
      @alt-enter237 3 года назад

      But what if your date table includes earlier dates not necessarily pertinent to sales? Such as employee hire date or birth dates? Removing the filter on the Date table would give you an artificially early date.

  • @pleblanc1972
    @pleblanc1972 3 года назад +2

    That was sooo good. Great explanation!!!

    • @SQLBI
      @SQLBI  3 года назад +1

      Not as good as the question! :)

  • @mshparber
    @mshparber 3 года назад +2

    Awesome guys!

  • @ralfabendt3725
    @ralfabendt3725 3 года назад +1

    Great video as always, I really owe my understanding of Dax to you guys. I just wonder here regarding firstdate. From my understanding removefilter on date is still too much as it returns always the first date in the date table (here it seems to be in 2010), however if I start my interval on for example 01/02/2020, I only want the first day before my selected interval. Therefore firstdate = min('date' [date]) - 1 should be better, or am I missing something?

    • @SQLBI
      @SQLBI  3 года назад

      If you need just a value use MIN, whereas FIRSTDATE is a table function it is used only when you filter a single value in a CALCULATE filter argument.

  • @georgecavaliotis8617
    @georgecavaliotis8617 3 года назад +1

    Nice video guys .... how would you go calculating number of consecutive weeks / days in top 5 ... something like a billboard...

  • @sansanhooning3465
    @sansanhooning3465 3 года назад +1

    Great video! How can you get the consecutive days WITH sales. I have a file with no 0 values and i cant figure it out how to make it work. Any tips?

  • @carlos27835
    @carlos27835 3 года назад +2

    Awesome!

  • @gambu4810
    @gambu4810 3 года назад +1

    Wow l love it. Can l request a slightly different problem solution?
    What about computing when days have NaNs? Please do a video about creating a machine learning model on data that has nans in some of the days. For the nans perhaps use the avarage of other days in different months for that day. Please please 🙏

  • @Prashantpatil-cq3yt
    @Prashantpatil-cq3yt 3 года назад +2

    Wao... What's a intro same to same...
    Like Patrick

  • @stanislavbularga7719
    @stanislavbularga7719 2 года назад

    Hello Alberto, great video, thank you very much !
    I would like to ask how to count month instead of dates.
    I figured out that i can create a column with month (and count the month numbers) but when it turns to the next year it is not counting the right way.
    For example if target was not reached 3 months in a row (Nov 2021, Dec 2021, Jan 2022) i am getting only consecutive for year 2021 of "0" and "1" but the 3rd number is (-10) instead of "2". - the right consecutive should be: target not reached: Nov 2021 (0) , Dec 2021 (1) , Jan 2022 (2)
    Any advice how to fix it ?
    Thank you very much

  • @derekoflions
    @derekoflions 3 года назад +1

    Nice work on the optimization Albertrick! ;) Any specific reason why doing int(date2-date1) instead of datediff() ?

    • @SQLBI
      @SQLBI  3 года назад +1

      Faster and same result - DATEDIFF is better for MONTH/QUARTER/YEAR when they match your requirements (check on dax.guide/datediff/ )

  • @pbihari0214
    @pbihari0214 3 года назад +2

    Thank you

  • @samson6874
    @samson6874 3 года назад +1

    I love this cross over, can we have more ?

  • @beginho2454
    @beginho2454 3 года назад +1

    it is corssover and perfect team work. 2 interesting DAX masters!
    i do wonder what keyboard are you using, may you share the model ;)

    • @SQLBI
      @SQLBI  3 года назад

      You can find the keyboard model here: www.sqlbi.com/blog/alberto/2021/02/14/on-my-recording-gear/

  • @mabl4367
    @mabl4367 3 года назад +2

    In the coalece we should use FirstDateEver-1. If not it will look as though there were sales on FirstDateEver even though there was not.

    • @SQLBI
      @SQLBI  3 года назад

      Good catch, I think you're right

  • @kiariesamuel2691
    @kiariesamuel2691 Год назад

    Hello SQLBI,
    How can I do an incremental refresh in power bi?

  • @martinbubenheimer6289
    @martinbubenheimer6289 3 года назад +1

    Amazing, Alberto! Is there a book or class where you teach how to systematically approach DAX performance issued?

    • @SQLBI
      @SQLBI  3 года назад +1

      You can find more in these resources:
      Book: www.sqlbi.com/books/the-definitive-guide-to-dax-2nd-edition/ (chapters 17-20 are all dedicated to optimization)
      Video course: www.sqlbi.com/p/optimizing-dax-video-course/

  • @The_Code_Father
    @The_Code_Father 3 года назад

    Excuse me Mr Alberto i know it's not relevant to this topic but I'm trying to calculate a number but I don't know how to do it with dax or power query
    I have a base salary for 2015 and it's raising by a fixed interest rate of 9% every year and i wanna get it's computed value to be in current year 2021
    I did it in excel formulas with FV function and i was moving forwards or backwards
    Can this calculation be done in dax or m code

    • @SQLBI
      @SQLBI  3 года назад +1

      You also have FV and other financial functions in DAX: dax.guide/functions/financial/

  • @DrActivO
    @DrActivO 3 года назад +2

    That was great! 😂

  • @colefogle421
    @colefogle421 Год назад

    Curious as to a workaround if I do not have an "Order Date" column in my sales table

  • @saikumarboga3383
    @saikumarboga3383 2 года назад

    Where can we find the dataset you are using?

  • @mshparber
    @mshparber 3 года назад

    Why don’t you clear cache before you run queries? The queries might use cache, what do I miss? Thanks

    • @SQLBI
      @SQLBI  3 года назад +1

      Performance was not the first goal in this unplugged, and the bigger cost is formula engine (not backed by cache).

  • @shivamsahay1994
    @shivamsahay1994 3 месяца назад

    Can we do it when all colors arecselected?

  • @mylifeisinhishandsamen4167
    @mylifeisinhishandsamen4167 2 года назад

    I want to count number of days with no sales and not number of days with no sales. Can you please give me an idea of how to go about it?

  • @mdhidayat5706
    @mdhidayat5706 3 года назад +1

    There is a for loop at the end of the video to enjoy DAX, otherwise great video on the thought process!

  • @danielgagnon8201
    @danielgagnon8201 3 года назад +2

    Professor Alberto

  • @ashokkumarbhishma
    @ashokkumarbhishma 2 года назад

    how to find the consecutive zero in a column irrespective of date

  • @moranschachar3642
    @moranschachar3642 3 года назад +1

    תודה רבה

  • @etukle
    @etukle 3 года назад +1

    you forgot to say"new vidoes by Marco and me" :)

  • @joeseroski1095
    @joeseroski1095 3 года назад +1

    "Code is not the fastest at half a second"... lol ... I would have settled at the 4 seconds.

  • @AgulloBernat
    @AgulloBernat 3 года назад

    CurrentDate could also be SELECTEDVALUE instead of MAX?

    • @SQLBI
      @SQLBI  3 года назад +1

      Only if you are slicing by Date. If you do that by month, it would fail. Actually, my code would produce strange results too... the result for an aggregation of dates should be defined by the users.

  • @arameshkumar5072
    @arameshkumar5072 3 года назад +1

    Yo ❤️, sounds familiar for me 🤣

  • @DIGITAL_COOKING
    @DIGITAL_COOKING 3 года назад +1

    indeed DAX is the heart of power bi

  • @diegomex85
    @diegomex85 3 года назад +2

    hahah aamazing #ForMoreAlbertoLikePatrick

  • @ivandumalovskijanjusic1159
    @ivandumalovskijanjusic1159 3 года назад +2

    It's always TREATAS ({"Alberto"}, watch)

  • @fatjanpaloja9182
    @fatjanpaloja9182 3 года назад +1

    The Dax men ☺️

  • @Prashantpatil-cq3yt
    @Prashantpatil-cq3yt 3 года назад +1

    Sir please ask subscribers for their problem and scenarios which they are facing when developing reports...
    So most of them will tell you about their problems and scenarios so you can make videos on solving that problem...
    So more the content, more the comments and more the views as well subscribers....
    Because you have much expertise in DAX...
    Thanks
    I mean to start doubt clearing video series...
    And put it the pbix file along with that video... So it will also useful

  • @subjectline
    @subjectline 3 года назад +2

    TCHAO!

  • @adan8657
    @adan8657 3 года назад +2

    The boring Alberto and his PC, 👍

  • @SiraEkabutPlus
    @SiraEkabutPlus 3 года назад +1

    Ha ha ha

  • @DBogey
    @DBogey Год назад +1

    Watching this now. Interesting and I"m wondering if ChatGPT 4 can solve this. Will try later. Thanks for all the work you put into this channel. You've helped me grow in the BI field.

  • @jevonzhu
    @jevonzhu 11 месяцев назад

    Nice imitate