Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
CWarm
New Member

PowerBI Power Query Editor Lookup Based on Dates from Both Tables

I currently have two tables - "On-Hold Table" and "Submission Lifecycle" Table in the Power Query Editor in PowerBI, with the important columns below.

 

On-Hold Table - id, on_hold_date, off_hold_date

Submission Lifecycle - id, submission_number, submission open date, submission end date

 

My goal is to add the submission_number from the Submission Lifecycle table to the On-Hold Table.  The submission_number returned should be the latest open date (prior to the on_hold_date). 

Example:

On Hold Table: id=HG123, on_hold_date=01/05/2022, off_hold_date=1/8/2022 - SHOULD bring back submission_number=2

Submission Lifecycle:

id=HG123, submission_number=1, submission open date=12/01/2021, submission end date=12/31/2021

id=HG123, submission_number=2, submission open date=01/04/2022, submission end date=null

 

Additional Notes:

  • id can be duplicated in both tables (but the combination of the id & submission_number only appears once in the Submission Lifecycle table)
  • the off_hold_date could be null or a date
  • submission end date could be null or a date
  • submission open date will not be null
  • Time stamp is included with all dates (don't know if that matters)

I have done this in excel, but can't figure out how to do it in the Power Query

I hope someone can help, thank you for your time!

1 REPLY 1
Anonymous
Not applicable

try this

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.