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
MrTechie
Frequent Visitor

Merge Queries in Power Query

Hello community, I have data as below,

Table 1:

Date                  AccountCode                            Value

1/01/2024nullnull
31/12/2023nullnull
30/12/2023nullnull
29/12/2023nullnull
28/12/2023nullnull
27/12/2023nullnull
26/12/2023nullnull
25/12/2023nullnull
24/12/2023nullnull
23/12/2023Allocated Delivery0.262
23/12/2023Authorised Overrun Reservation0.025
22/12/2023Authorised Overrun Reservation0.025
22/12/2023Allocated Delivery0.245

 

Table 2:

 

Date               AccountCode                               Value

1/01/2024nullnull
31/12/2023Allocated Delivery31
31/12/2023Authorised Overrun Reservation31
30/12/2023Allocated Delivery30
30/12/2023Authorised Overrun Reservation30
29/12/2023Allocated Delivery29
29/12/2023Authorised Overrun Reservation29
28/12/2023Authorised Overrun Reservation28
28/12/2023Allocated Delivery28
27/12/2023Authorised Overrun Reservation27
27/12/2023Allocated Delivery27
26/12/2023Authorised Overrun Reservation26
26/12/2023Allocated Delivery26
25/12/2023Allocated Delivery25
25/12/2023Authorised Overrun Reservation25
24/12/2023Authorised Overrun Reservation24
24/12/2023Allocated Delivery24
23/12/2023Allocated Delivery23
23/12/2023Authorised Overrun Reservation23
22/12/2023Authorised Overrun Reservation22
22/12/2023Allocated Delivery22

 

when I merge the above two tables using Full Outer join and Date, Account Code as key columns, I am getting weird output.

MrTechie_0-1703443464667.png

 I didn't understand why the query created extra rows. My expected output is:

MrTechie_1-1703443730559.png

 

 

Finally, I want to achieve, if the date is < today, then get value else Table_2.Value.

 

Please suggest me how to do this. TIA

 

 

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

3 REPLIES 3
Ahmedx
Super User
Super User

pls try this

Screenshot_4.png

if you need less today then do this

Screenshot_6.png

zenisekd
Super User
Super User

@MrTechie, take a look if full outer join is really what you are looking for. https://radacad.com/choose-the-right-merge-join-type-in-power-bi

 

The main problem for you is that you use as the key columns 'date' and 'account code'. However, in your data you have 'account code' null in table 1 and something specific account in table 2. so instead of pairing, it creates two rows. 

Perhaps left anti would be more suitable for you... 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

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.