Consecutive days with no sales - Unplugged #18

  Рет қаралды 16,697

SQLBI

SQLBI

3 жыл бұрын

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/blog/marco/2021...
#unplugged

Пікірлер: 94
@JBartlett_DMU
@JBartlett_DMU 3 жыл бұрын
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.
@PowerBIGuy
@PowerBIGuy 3 жыл бұрын
Brilliant intro and some very helpful DAX. Also, you could never be boring Alberto!
@michelcesar85
@michelcesar85 3 жыл бұрын
Amazing Alberto imitating Patrick 🤣🤣🤣...exepcional video!
@obazeeghosa
@obazeeghosa 11 ай бұрын
Simply Excellent! This is precision DAX Engineering
@dhruvsingh9
@dhruvsingh9 3 жыл бұрын
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 жыл бұрын
you are clearly DaBoss! - amazing troubleshooting and explanation , step by step.
@MatthiasK-qp9bf
@MatthiasK-qp9bf 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 2 жыл бұрын
L'eroe di cui abbiamo bisogno, ma che non meritiamo!! Grazie sempre eccezionale!
@salvatorescofano6756
@salvatorescofano6756 3 жыл бұрын
Congratulations Alberto, It was the best DaX class, which I attended, challenging
@alexkim7270
@alexkim7270 Жыл бұрын
Oh my goodness! You guys doing such a good intro using each other's scripts! Haha!
@NirRobinson
@NirRobinson 3 жыл бұрын
Master piece. So much knowledge and adjustments to dax code in just several of minutes. 10x!!!
@hlambert100
@hlambert100 2 жыл бұрын
Thank you very much, Two times you save my work with your amazing and complete videos.
@bouseuxlatache4140
@bouseuxlatache4140 Жыл бұрын
this was really cool blending together the american coolness and the italian class together
@drod96
@drod96 3 жыл бұрын
I have been literally working on this problem for the the last few weeks! Thank you!!!
@marshal115
@marshal115 3 жыл бұрын
What an amazing collaboration🤣
@rick_.
@rick_. 3 жыл бұрын
Awesome, thank you! It is really helpful having you explain your thought process as you work through optimizing the code.
@cptdeadeye2112
@cptdeadeye2112 3 жыл бұрын
Saved me again, while teaching me new things in the process. Greatly appreciated.
@Milhouse77BS
@Milhouse77BS 3 жыл бұрын
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!
@erickknackstedt3131
@erickknackstedt3131 3 жыл бұрын
This intro was amazing! Great work.
@EricaDyson
@EricaDyson 3 жыл бұрын
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 жыл бұрын
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
@franciscoclaudio4818
@franciscoclaudio4818 3 жыл бұрын
thank you so much! Brazilian greetings.
@carlos27835
@carlos27835 3 жыл бұрын
Awesome!
@sue_bayes
@sue_bayes 3 жыл бұрын
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.
@alt-enter237
@alt-enter237 2 жыл бұрын
100% agree Sue!
@filip3783
@filip3783 3 жыл бұрын
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 :)
@MdShahidulIslamshafimbd
@MdShahidulIslamshafimbd 3 жыл бұрын
Love you guys. Really insightful
@rerangelt
@rerangelt 3 жыл бұрын
Jajaja. This was a great intro. And a great video, as always.
@workstuff5253
@workstuff5253 3 жыл бұрын
Love this crossover video style!!
@mshparber
@mshparber 3 жыл бұрын
Awesome guys!
@furk97
@furk97 3 жыл бұрын
It is getting better and better LOL.
@sonetmollick4630
@sonetmollick4630 2 жыл бұрын
Thanks Alberto. You are the best :)
@chrissavop5985
@chrissavop5985 3 жыл бұрын
Another Excellent video, you make it looks so easy but it’s definitely not. Thank you
@pleblanc1972
@pleblanc1972 3 жыл бұрын
That was sooo good. Great explanation!!!
@SQLBI
@SQLBI 3 жыл бұрын
Not as good as the question! :)
@Prashantpatil-cq3yt
@Prashantpatil-cq3yt 3 жыл бұрын
Wao... What's a intro same to same... Like Patrick
@pbihari0214
@pbihari0214 3 жыл бұрын
Thank you
@DrActivO
@DrActivO 3 жыл бұрын
That was great! 😂
@mabl4367
@mabl4367 3 жыл бұрын
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
@samson6874
@samson6874 3 жыл бұрын
I love this cross over, can we have more ?
@sane7263
@sane7263 2 жыл бұрын
As always best content❤, The crossOver was Lit.......suggestion: why not Hollywood Alberto?
@moranschachar3642
@moranschachar3642 3 жыл бұрын
תודה רבה
@alphatradingmethod1193
@alphatradingmethod1193 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/
@mjwj88
@mjwj88 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.)
@sebastienfanget3977
@sebastienfanget3977 Жыл бұрын
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 ?
@arameshkumar5072
@arameshkumar5072 2 жыл бұрын
Yo ❤️, sounds familiar for me 🤣
@georgecavaliotis8617
@georgecavaliotis8617 3 жыл бұрын
Nice video guys .... how would you go calculating number of consecutive weeks / days in top 5 ... something like a billboard...
@diegomex85
@diegomex85 3 жыл бұрын
hahah aamazing #ForMoreAlbertoLikePatrick
@derekoflions
@derekoflions 3 жыл бұрын
Nice work on the optimization Albertrick! ;) Any specific reason why doing int(date2-date1) instead of datediff() ?
@SQLBI
@SQLBI 3 жыл бұрын
Faster and same result - DATEDIFF is better for MONTH/QUARTER/YEAR when they match your requirements (check on dax.guide/datediff/ )
@danielgagnon8201
@danielgagnon8201 3 жыл бұрын
Professor Alberto
@gambu4810
@gambu4810 2 жыл бұрын
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 🙏
@ralfabendt3725
@ralfabendt3725 3 жыл бұрын
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.
@wmfexcel
@wmfexcel 3 жыл бұрын
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 жыл бұрын
You're right about removing the filters - clearly, it depends on your requirements.
@wmfexcel
@wmfexcel 3 жыл бұрын
@@SQLBI thank you so much for your prompt reply! 🙏🏻👍🏻
@alt-enter237
@alt-enter237 2 жыл бұрын
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.
@beginho2454
@beginho2454 3 жыл бұрын
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/
@martinbubenheimer6289
@martinbubenheimer6289 3 жыл бұрын
Amazing, Alberto! Is there a book or class where you teach how to systematically approach DAX performance issued?
@SQLBI
@SQLBI 3 жыл бұрын
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/
@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
@sansanhooning3465
@sansanhooning3465 2 жыл бұрын
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?
@fatjanpaloja9182
@fatjanpaloja9182 3 жыл бұрын
The Dax men ☺️
@colefogle421
@colefogle421 Жыл бұрын
Curious as to a workaround if I do not have an "Order Date" column in my sales table
@subjectline
@subjectline 3 жыл бұрын
TCHAO!
@etukle
@etukle 3 жыл бұрын
you forgot to say"new vidoes by Marco and me" :)
@shivamsahay1994
@shivamsahay1994 7 күн бұрын
Can we do it when all colors arecselected?
@joeseroski1095
@joeseroski1095 3 жыл бұрын
"Code is not the fastest at half a second"... lol ... I would have settled at the 4 seconds.
@DIGITAL_COOKING
@DIGITAL_COOKING 3 жыл бұрын
indeed DAX is the heart of power bi
@mdhidayat5706
@mdhidayat5706 3 жыл бұрын
There is a for loop at the end of the video to enjoy DAX, otherwise great video on the thought process!
@SQLBI
@SQLBI 3 жыл бұрын
It was intentional! :)
@mdhidayat5706
@mdhidayat5706 3 жыл бұрын
@@SQLBI 🤣
@kiariesamuel2691
@kiariesamuel2691 Жыл бұрын
Hello SQLBI, How can I do an incremental refresh in power bi?
@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 жыл бұрын
You also have FV and other financial functions in DAX: dax.guide/functions/financial/
@saikumarboga3383
@saikumarboga3383 2 жыл бұрын
Where can we find the dataset you are using?
@ivandumalovskijanjusic1159
@ivandumalovskijanjusic1159 3 жыл бұрын
It's always TREATAS ({"Alberto"}, watch)
@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 жыл бұрын
Performance was not the first goal in this unplugged, and the bigger cost is formula engine (not backed by cache).
@ashokkumarbhishma
@ashokkumarbhishma Жыл бұрын
how to find the consecutive zero in a column irrespective of date
@AgulloBernat
@AgulloBernat 3 жыл бұрын
CurrentDate could also be SELECTEDVALUE instead of MAX?
@SQLBI
@SQLBI 3 жыл бұрын
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.
@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?
@mylifeisinhishandsamen4167
@mylifeisinhishandsamen4167 2 жыл бұрын
Hi, I got it now...your video gave me a clue as to what I should do. Thank you!
@adan8657
@adan8657 3 жыл бұрын
The boring Alberto and his PC, 👍
@SiraEkabutPlus
@SiraEkabutPlus 3 жыл бұрын
Ha ha ha
@Prashantpatil-cq3yt
@Prashantpatil-cq3yt 3 жыл бұрын
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
@jevonzhu
@jevonzhu 8 ай бұрын
Nice imitate
@DBogey
@DBogey Жыл бұрын
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.
Using ALLEXCEPT vs ALL VALUES
13:35
SQLBI
Рет қаралды 53 М.
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 143 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 54 МЛН
100❤️
00:19
MY💝No War🤝
Рет қаралды 21 МЛН
Working below a DAX formula’s granularity
15:16
SQLBI
Рет қаралды 19 М.
Calculate Growth From Previous Non Consecutive Date
8:52
Goodly
Рет қаралды 16 М.
Flight Secrets That Are Never Told To Passengers
24:39
BE AMAZED
Рет қаралды 27 МЛН
When to use KEEPFILTERS over iterators
18:56
SQLBI
Рет қаралды 47 М.
Power BI & DAX: What to Do When Power BI Totals are Wrong
9:19
KnowledgeBank by obviEnce
Рет қаралды 14 М.
How to Specify Multiple Filter Conditions in CALCULATE [Power BI]
18:03
Nestor Adrianzen
Рет қаралды 27 М.
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 3,1 МЛН
Я УКРАЛ ТЕЛЕФОН В МИЛАНЕ
9:18
Игорь Линк
Рет қаралды 97 М.
Опять съемные крышки в смартфонах? #cmf
0:50
WATERPROOF RATED IP-69🌧️#oppo #oppof27pro#oppoindia
0:10
Fivestar Mobile
Рет қаралды 18 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,2 МЛН
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 354 М.