Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
I have two tables 1st table has a date and time column I would like to add two columns from the 2nd table based on the date/time column in the 1st table. I can only make a relatonship many to many using the month name in both table.
I want to add the DateFrom and DateTo columns from Table 2 to Table 1. If Table 1 Date/Time 12/01/2019 is between Table 2 25/12/2018 and 24/01/2019 then add those two columns to Table 1.
I can't use merge in Query Editor as it will create doubles and my DAX knowledge is limited
Hope you can help
Thanks
Table 1
Date/Time Year Month
12/01/2019 2019 January
26/02/2019 2019 February
Table2
DateFrom DateTo Year Month
25/12/2018 24/01/2019 2019 January
25/01/2019 24/02/2019 2019 February
This is how Table1 should look like after adding columns from Table 2
Table 1
Date/Time Year Month DateFrom Dateto
12/01/2019 2019 January 25/12/2018 24/01/2019
22/02/2019 2019 February 25/01/2019 24/02/2019
Solved! Go to Solution.
Is this because you are joining on onyl one colunm months and there are several years so it is not unique
if so then just create some new colunms on each of the table that combine your year and month colunms into one
Colunm = concat(year,month)
add this to both tables and then create your join on this colunm and you should get your one to many relation ship and beable to look up based on this value.
Proud to be a Super User!
Is this because you are joining on onyl one colunm months and there are several years so it is not unique
if so then just create some new colunms on each of the table that combine your year and month colunms into one
Colunm = concat(year,month)
add this to both tables and then create your join on this colunm and you should get your one to many relation ship and beable to look up based on this value.
Proud to be a Super User!
Hi Anthony
the very thing!
Cheers
Joe
@AnthonyTilley wrote:Is this because you are joining on onyl one colunm months and there are several years so it is not unique
if so then just create some new colunms on each of the table that combine your year and month colunms into one
Colunm = concat(year,month)
add this to both tables and then create your join on this colunm and you should get your one to many relation ship and beable to look up based on this value.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |