Forum Discussion
Uncle_J
May 23, 2019Copper Contributor
Joining two tables using different columns
Hi I have "Office 365 Business"
I have imported a table A containing the columns StartDate and EndDate, I have also created a "DimDate" table.
And now I want to do a "SELECT * FROM A LEFT JOIN DimDate D ON D.Date >=A.StartDate AND D.Date<=A.EndDate "
in order to have a fine PowerPivot dataset.
But SQL is long gone and replaced by M, and I'm lost!
Any tips / syntax suggestions?
1 Reply
- SergeiBaklanDiamond Contributor
Uncle_J ,
You may do that from user interface - query your A and DimDate tables, using Merge Queries left join them in new query or in query A, expand fields you need and filter result by date.
And you always may adjust generated M-script in advanced editor.