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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
BrandonH
Frequent Visitor

Conditional Merge Using IF Logic and Evaluation

Hello All, 

I am working on a project spanning 20+ queries. One of the evaluations I am trying to accomplish is to take a 'Training Date' in query 1 and evaluate if this date is in between a start date in one column and an end date in another column of query 2. If so then to return the record in query 2 that the date for query 1 falls within.

 

I know this is all very vauge. I am working with some protected information and would like to avoid sharing datasets or pictures unless explicitly needed.

 

I appreciate any insight you all may have. This may be my first post but I have visited the site before in my many searches for answers. 🙂 

 

 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @BrandonH ,

 

Spontaneously, I would try to change the granulariity of query2. More precisely, I'd unfold the data in query2 so one row of the table will become several rows where each row represents one day of the interval (start and end date). Afterwards join query1 and query2 in order to display the matches.

 

Here one way of detangling query2:

https://www.tackytech.blog/how-to-swiftly-take-over-power-query/#1_Unfold_expand_create_rows_between...

 

Note, this can be performance-heavy depending on the size of your tables, but maybe worth a shot anyway.

 

Let me know if this helps! 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

2 REPLIES 2
tackytechtom
Super User
Super User

Hi @BrandonH ,

 

Spontaneously, I would try to change the granulariity of query2. More precisely, I'd unfold the data in query2 so one row of the table will become several rows where each row represents one day of the interval (start and end date). Afterwards join query1 and query2 in order to display the matches.

 

Here one way of detangling query2:

https://www.tackytech.blog/how-to-swiftly-take-over-power-query/#1_Unfold_expand_create_rows_between...

 

Note, this can be performance-heavy depending on the size of your tables, but maybe worth a shot anyway.

 

Let me know if this helps! 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hello @tackytechtom

 

I appreciate the response and time you took to provide feedback. I will work today to try to unfold the data in my second query. I will provicde some feedback sometime soon and accept as a solution if I can get it working. Take care!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors