Range Lookup in Power BI in the Power Query Editor

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • In this video we take a look at how to perform a range lookup in Power BI. Learn how to lookup a value in a table where the date falls between a start date and end date! This videos focuses on how to perform this activity in the Power Query Editor.
    If you enjoy this video and are interested in formal training on DAX, Power BI, Power Apps, Azure, or other Microsoft products you can use my code "Mitchell20" to receive a discount at check out when purchasing On-Demand Learning classes from pragmaticworks...
    Dimensional Modeling Book:
    www.amazon.com...
    #PragmaticWorks #MitchellPearson #MitchellSQL
    ~-~~-~~~-~~-~
    Please watch: "(275) Free Pragmatic Works Power Apps Component Library "
    • Free Power Apps Compon...
    ~-~~-~~~-~~-~

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

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

    Incredible! I've searched high and low for this solution. I found the blog you mentioned but you made the steps super simple to follow and understand. Thank you!

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

    THANK YOU! I've been looking for this for two days! My heart is happy! 🌞

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

    this is exactly needed now in my project :D Thanks!

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

    sending love from egypt , thank you man

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

    This was awesome! Thanks so much for taking the time share.

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

    Brilliant! Yes, Data modelling best practices videos please

  • @Abder-v4q
    @Abder-v4q ปีที่แล้ว

    Many thanks i was looking to this since a lot of weeks

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

    This is excellent! Yes, please do a series on data modeling! Thank you - I’ve subscribed!

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

    Mitchell great video, I would be interested in a series on data modeling

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

      Thank You Tina! -Mitchell Pearson

  • @johnabram4159
    @johnabram4159 2 ปีที่แล้ว +4

    Hi Mitchell, @ 2:19 you said you will put a link to your favorite dimensional modelling book. No link found! Could you please?

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

      Hey John, sorry about that! I added it to the description. My apologies.

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

    Thanks! I don't know it is still good what I did; but I just did you procedured twice, because I have a matching table inbetween :) --> but it seems to work for now.

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

    Brilliant! Thank you so much

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

    thanks so much for this video!

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

      You're welcome! Glad you enjoyed!

  • @tramle3382
    @tramle3382 3 หลายเดือนก่อน

    cool tutorial thanks bro

  • @aunad___
    @aunad___ 5 หลายเดือนก่อน

    how do we do this in DAX please? did you end up sharing the video? i couldn't find it

  • @jessicalouis-marie7453
    @jessicalouis-marie7453 ปีที่แล้ว

    great thanks exactly what I needed, quick question if by doing this my results still returns 3 rows (start date in my date range changed slightly) so I would like to return the most recent start date, how would I do that , was think about max startdate but can not make it work

  • @ankitsingh-lp2zq
    @ankitsingh-lp2zq 11 หลายเดือนก่อน

    That's what we want 😎😎

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

    It works... Thank you!

  • @williamarthur4801
    @williamarthur4801 11 หลายเดือนก่อน

    Is there a link to blog?

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

    Can I use a trick like this for doing product pricing? (my "recipe" stays the same, but ingredient prices change all the time) So I basically need to get "current" prices as of the date in the current evaluation context... ?

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

    Hi, This is excellent and very easy to understand and replicate.
    Thanks for sharing here.....Only one clarification....I applied the same, by the value/rate what I tried to map, but is is creating with rounding up (Ex- If the price is to be mapped is 226.71, it is getting updated as 227), I have ensured the format in same form in all the places but luck.
    Is there some thing else, I need to update as settings, Could you please suggest

  • @unitedeurope8614
    @unitedeurope8614 11 หลายเดือนก่อน

    I have this solution, the problem is: if there is a nul oder error value to be looked up, the query will fail in the expand step (the query will fail to load completely afer the offending record)

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

    Very nice example m8.

  • @10ozGold
    @10ozGold 2 ปีที่แล้ว

    Excellent video Mitchell. What's the link to the Direct Lookup using Crossjoin that was mentioned at the 5:10 mark?

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

    Wow...mindblown...
    The solution looks simple yet very elegant and beautifully written in PowerQuery.

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

    This is great! Can you do something similar but with a range of numbers rather than dates to look in? For example, return the value associated with a number between 0-99, return a different value if it falls between 100-199, return a different value if it falls between 200-299, etc.

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

    👏 interested

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

    I subscribed long time ago. :D

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

      haha, awesome and thanks :) -Mitchell Pearson

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

    Keen

  • @walterstevens8676
    @walterstevens8676 3 หลายเดือนก่อน

    Really keen on a data modelling course!

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

    Did anyone try this with a large dataset? I have 2 tables that contain a few 100K records per table. But it keeps loading forever. Not sure if I did something wrong, or if I should continue looking for another solution. Thanks!

    • @OscarPerez-hi7hq
      @OscarPerez-hi7hq 5 หลายเดือนก่อน

      @PragmaticWorks second this request. It works, but not on large data sets. Any solutions?

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

    Also keen. And great video! Perfect timing for a challenge on my desk!

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

      Thanks James, glad this video was helpful!

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

    This worked perfectly for my case, thank you !

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

    Hi, excellent video. In my case, it works in the power query editor but takes way too long to refresh in the reports tab. Any advice to solve this problem? maybe creating a column in the data tab with Dax would help to make it faster.

    • @arnaultc.5790
      @arnaultc.5790 ปีที่แล้ว

      Same problem for me. It does not seem to be a proper solution for large datasets.

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

      Same problem here. Takes infinity to calc 50MB model. My best guess is that value of VAR currendate (=[auditdate] should be somehow cleared, after each record). But, I do not know how to do it. Any idea?

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

      I think using table.buffer may help eith speed and efficiency

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

    Great video, please provide the links mentioned in your tutorial. Thanks

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

      Hey Daniel, my apologies! I added a link to the book on Amazon.

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

      @@PragmaticWorks no apologies needed. Thanks for providing such a great content !

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

    Any reason why this method fails if we select as Merge as a new query. It works fine with Merge Queries.

  • @PradeepKumar-mh5ht
    @PradeepKumar-mh5ht ปีที่แล้ว

    This trick is really awesome, Thanks for sharing it.

  • @gfbordin
    @gfbordin 8 หลายเดือนก่อน

    Great Solution, Thanks!

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

    May I ask where is the link of that blog you were looking at?

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

    Wonderful

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

    Yes for saries on data modeling

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

    thanks

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

    good example ;)

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

    Thank you. I was able to use this to calculate an aggregation I've been trying to do for a while. Given an employee's start and end date, how many employee's were employed on any given date. I just took the Add column expression from this video and applied it to a Date Table with out joining it to my Employee Hire Dim Table.
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Employee Aggregate", each let currentdate = [Date] in Table.SelectRows(EmployeeHireDim, each [StartDate] = currentdate)),
    #"Aggregated Employee Aggregate" = Table.AggregateTableColumn(#"Added Custom", "Employee Aggregate", {{"EmployeeID", List.Sum, "Sum of EmployeeID"}, {"EmployeeID", List.NonNullCount, "Count (Not Blank) of EmployeeID"}})