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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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