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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
Most Valuable Professional
Most Valuable Professional

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
Most Valuable Professional
Most Valuable Professional

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors