Create a Join based on Date Range in Power Query

  Рет қаралды 6,212

BI Gorilla

BI Gorilla

Күн бұрын

This video shows two methods to create a join between tables based on a range of dates.
You can buy the Definitive Guide to Power Query M here: geni.us/ODZl8
CONTENTS
00:00 Introduction
01:16 Data
01:55 Method 1: Date range join
08:21 Method 2: Explode dates
WRITTEN ARTICLE:
gorilla.bi/power-query/join-o...
Master Functions and Syntax in M
powerquery.how
ABOUT BI Gorilla:
BI Gorilla shares videos and articles on Power BI and Excel to help you improve your skills.
Website: gorilla.bi
SUBSCRIBE TO MY CHANNEL
kzfaq.info?sub_con...
LET'S CONNECT:
Blog: gorilla.bi
Facebook: / bigorilla
Twitter: / rickmaurinus
LinkedIn: / rickmaurinus
Thank you for your support!
#Join #powerquery #bigorilla

Пікірлер: 51
@BIGorilla
@BIGorilla 2 ай бұрын
For method 1, don't forget to add Table.Buffer to the Campaign table. Totally forgot showing that in the video. Find the written article at: gorilla.bi/power-query/join-on-date-range/
@scramiro1
@scramiro1 2 ай бұрын
Thanks. I would appreciate a video about this function. I know the formula has two options. People use it normally at the beginning to buffer the table, but it can be used at the end too of the query step. I can't get around what option to use in what circumstances. Do should we always buffer at the beginning or end? A video would be great, thanks, because I haven't found any.
@drewbbc7074
@drewbbc7074 6 күн бұрын
All - i) approach number 2 is being used to manage a contract mgmt tool that expands to 20k row transaction table - all with very low latency. ii) IMV, approach number 2 is easier to debug. Sample code is available if anyone is interested.
@CeliaAlvesSolveExcel
@CeliaAlvesSolveExcel 2 ай бұрын
So much to learn in this video! It is bookmarked. Thank you, Rick! I particularly enjoyed the concepts of inner and outer contexts. Had I known this before and I could have used it a couple of times already. One little request for your next videos: if you could please apply more zoom in, it would be great! On this one, it was nearly impossible for my old eyes to read the code. Good thing that your explanation was perfect and helped me fill in the blurs.😊
@BIGorilla
@BIGorilla 2 ай бұрын
Hey Celia - thank you! Yes, that inner and outer context can be confusing. Also appreciate the feedback on the text size. I will try to improve that on some of the next videos 🙌
@ThepExcel
@ThepExcel 2 ай бұрын
Already bought your new book yesterday. Thx for great knowledge as always
@williamarthur4801
@williamarthur4801 2 ай бұрын
As always learnt something new, data type can go in curly brackets. never occurred to me before. Thank you.
@BIGorilla
@BIGorilla 2 ай бұрын
You're very welcome !
@GrainneDuggan_Excel
@GrainneDuggan_Excel 2 ай бұрын
To me, the second example is easier to understand. Perhaps when I reach chapter 9 of the Definitive Guide to Power Query (M) , I will find them both easy. I loved first 4 chapters that I have worked through so far. Great book Rick!
@BIGorilla
@BIGorilla 2 ай бұрын
It will be easier by than. For sure!
@petervanbussel7975
@petervanbussel7975 Ай бұрын
Very nicely explained. Wonder how this works when you have two tables with different date ranged that needs to be merged.
@carloserodriguez2465
@carloserodriguez2465 2 ай бұрын
I bought the book and I am going thru the Chapter 4. Totally recommend it!!!!
@BIGorilla
@BIGorilla 2 ай бұрын
You’re awesome! ❤
@scramiro1
@scramiro1 2 ай бұрын
Love it! I am working on a similar scenario. I used the first scenario, but I think the second is easier and faster 😅. I will definitely buy your book and subscribe to your channel.
@BIGorilla
@BIGorilla 2 ай бұрын
I agree with you. The first concept is great for understanding M though, or for joins that require more complex conditions. There's something there for everyone :)
@vinhwizard
@vinhwizard 2 ай бұрын
Thank you so much for beautiful methods
@BIGorilla
@BIGorilla 2 ай бұрын
You are so welcome!
@giuseppefenzi2942
@giuseppefenzi2942 Ай бұрын
Thank you, brilliant as usual. I bought the book!
@baskis69
@baskis69 2 ай бұрын
Brilliant! Thanks for sharing...the book is on its way...looking forward to continue learning with the book!
@BIGorilla
@BIGorilla 2 ай бұрын
Wonderful, hope you enjoy it! 🎉
@BHASKARJOSHI-cw7qn
@BHASKARJOSHI-cw7qn 2 ай бұрын
Loved it
@BIGorilla
@BIGorilla 2 ай бұрын
Thanks buddy!
@jerrydellasala7643
@jerrydellasala7643 2 ай бұрын
Great techniques! BTW, that yellow dot is VERY OBTRUSIVE blocking code when trying to follow along. Of course that wouldn't be such a problem if the Workbook were provided...
@BIGorilla
@BIGorilla 2 ай бұрын
Jerry! Yes I agree. I’ll get rid of that yellow dot. By the way. Did you check out the video description? It’s got the written article url. And guess what. It has the code readily available for you to use in your workbook. You’re welcome 🙋‍♂️ enjoy !
@MrJadison7
@MrJadison7 2 ай бұрын
Hello Rick, thank you for the video. Can you tell which of the 2 methods works better performance wise
@BIGorilla
@BIGorilla 2 ай бұрын
If I had to guess, I would say it's method 2 where we perform a regular left outer join. But I should test this be sure!
@williamarthur4801
@williamarthur4801 2 ай бұрын
I shall certainly be looking into getting the book, BTW have you thought about a video on the fuzzies, nested join , cluster columns , cluster group etc., or how about the most inventive use of list.alternate ? I'll have to watch this again and work through properly, always enjoy your work.
@BIGorilla
@BIGorilla 2 ай бұрын
Hey William - definitely some good topics to look into. List.Alternate I don't use so much. And the fuzzies not either. But that would make it extra relevant. Thanks for your suggestions! Rick
@williamarthur4801
@williamarthur4801 2 ай бұрын
@@BIGorilla the only thing I've use list alt for is to create a list to feed to list .Accumulate ( .... Table Insert Rows ( let rc = Table.RowCount ( Source ) , grupe = 5, skip = 3 , rowinsert = 3 , slist ={ 0.. ( Number.IntegerDivide( rc, grupe) * rowinsert)+rc }, altlist = List.Alternate( slist, (grupe + rowinsert) , 1 ) in altlist you then have to have a ckeck to gurpe / row count = number Int divide ( grupe , orwcount ) so as not to end up with extra rows inserted at bottom of table , if true list remvoe last, Oh, I finally got to grips with how you List Gernerate running total actually works. 😊😊
@BIGorilla
@BIGorilla 2 ай бұрын
@@williamarthur4801 Thanks for sharing your great example. I was just thinking. You'll find an example using List.Alternate in my new article: gorilla.bi/power-query/switch/. Maybe it provides some new inspiration :)
@danielgoncalveslima9350
@danielgoncalveslima9350 2 ай бұрын
In the first example, would making a reference to the outside table without attaching it to the main table change performance?
@nishantkumar9570
@nishantkumar9570 2 ай бұрын
I always wonder is Merging operation in Power Query is a expensive in terms of computation point of view. How backend engine works? Thanks so much for such neat tricks.
@BIGorilla
@BIGorilla 2 ай бұрын
I will do some performance testing and report back on the performance in the written blog article!
@bertbrug
@bertbrug Ай бұрын
For the second method, when I merge into the transactional query. What happens when campaigns have overlapping periods?
@ExcelInstructor
@ExcelInstructor 2 ай бұрын
Hi Rick, Great Video, a question tho, why use 2 separate indicators T and C, the C one alone should be sufficient. So was it just to demonstrate what each is?
@BIGorilla
@BIGorilla 2 ай бұрын
That's a great question. As you say, it would be plenty to use a single indicator, and leave 'each' for one of the two functions. I used this to make it very explicit of what's happening. The thing is, when we use 'each', which is equivalent to '(_) =>', you will not see the underscore used after. That is because the simplified expression can leave out the underscore for referencing fields. I felt making this more explicit would be helpful for a reader. Glad you asked, thanks!
@ExcelInstructor
@ExcelInstructor 2 ай бұрын
@@BIGorilla I know PQ quite well, thats why I asked, and honestly both solutions will work ofcourse, but also to me the second would be beating around the bushes solution, where the 1st one is str8 forward to the expected result. I dealt with extremly hard cases in my previous work, so if I can achive 1 step (1st solution) a way of combining data I will go for it since then the rest of the code will be smaller aswell, However the second solution is great one for someone less expierienced, and yes im talking here about when I learned PQ, I would go for that back then. Anyway - glad your still doing videos! you dealt with some problems I had in the past and I was able to use fully or partialy your ideas to suit what needed. so Thank you for your tutorials in PQ!
@BIGorilla
@BIGorilla 2 ай бұрын
@@ExcelInstructor I might measure the performance later and report back. Also, I'm glad to find you back on the channel. Thank you!
@att6098
@att6098 2 ай бұрын
Hi, Rick, Is it possible to have the sample files for practice? thanks,
@BIGorilla
@BIGorilla 2 ай бұрын
Theres no file, but the code is available for free on gorilla.bi/power-query/join-on-date-range/. You can then paste it into your queries 🙏🌞
@ferdirosa7547
@ferdirosa7547 2 ай бұрын
Goedenmorgen Rick, ik werk vaak met veel kolommen die ik nu horizontaal moet slepen om ze in een bepaalde volgorde te zetten. Ik meen dat ik ooit gezien had dat je ze ergens in een menu verticaal kunt slepen maar ik kan het niet terugvinden. Weet jij dat? Dankjewel.
@BIGorilla
@BIGorilla 2 ай бұрын
Hey Ferdi - ja dat is soms onhandig. Je zou ook rechterknop kunnen doen op een kolom. Dan staat er iets van ‘Move’ - move to beginning’ of ‘move to end’. Je kunt als alternatief ook de kolommen selecteren in de volgorde die je wilt. Wanneer je alles hebt geselecteerd, kies je dan ‘Remove Other Columns’. Dan staan de kolommen ook in de gewenste volgorde. Het menu wat jij bedoelt is denk ik degene die je ziet wanneer je in de ‘Home’ tab van de ribbon kiest voor ‘choose columns’
@ferdirosa7547
@ferdirosa7547 2 ай бұрын
@@BIGorilla Dankjewel Rick
@SamehRSameh
@SamehRSameh 2 ай бұрын
Can i get free pdf one from this book
@BIGorilla
@BIGorilla 2 ай бұрын
Hey Sameh - absolutely , when you buy the printed book, you can get the pdf with it for free. Hope that helps :)
@FabioRBelotto
@FabioRBelotto 2 ай бұрын
Pwbi is very nice, but as soon as you plug a table with 100 mm tables it becomes a trash for any kind of joins oi treatments!
@BIGorilla
@BIGorilla 2 ай бұрын
Buffering operations like group by, pivot, sort etc are expensive. Who knows you can offload them to your datawarehouse. Would be good :)
@Nazeerul_Hazard
@Nazeerul_Hazard 2 ай бұрын
And knowing how formula and storage engine work also can help you overcome challenges when working with large tables
@BIGorilla
@BIGorilla 2 ай бұрын
@@Nazeerul_Hazard I wish Power Query had such engines. You're gonna have to look at the Vertipaq engine for DAX for that unfortunately.
@SamehRSameh
@SamehRSameh Ай бұрын
Plz zoom in
The Definitive Guide to Power Query M - What to expect?
27:13
BI Gorilla
Рет қаралды 3,9 М.
Fast Running Totals in Power Query (Complete Guide)
29:16
BI Gorilla
Рет қаралды 26 М.
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 25 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 110 МЛН
Custom Comparer Function for Table.Group in Power Query M
23:17
BI Gorilla
Рет қаралды 4,2 М.
Power Query - Alternate Group By Strategies
12:29
BCTI
Рет қаралды 2,7 М.
Power Query Pattern Extraction with Melissa de Korte
1:06:08
Devon and Cornwall User Group | Sue Bayes
Рет қаралды 3,4 М.
Mimic a SWITCH function in Power Query using Record.FieldOrDefault
10:15
10 awesome Power Query tricks you NEED to know! | Excel Off The Grid
15:44
Excel Off The Grid
Рет қаралды 27 М.
Create a Running Total by Category in Power Query
17:44
BI Gorilla
Рет қаралды 27 М.
Understanding Enumerations in Power Query M
10:17
BI Gorilla
Рет қаралды 3,2 М.