Forum Discussion
How to merge two date columns into one
Hi Community,
I have two date columns startdate and enddate.
I want to combine these columns to have one date column to calculate startofmonth etc. calculations.
I tried combining these using power query but its showing incorrect data in report when I apply date filter using the new date column created.
I have null values as well in my date columns.
Can anybody help.
Thanks,
R
krahul57
Here are some choices where you can select based on your business logic https://www.dropbox.com/t/6HAJXVx3YQERD6Jv
10 Replies
- tamerj1
Community Champion
krahul57
Here are some choices where you can select based on your business logic https://www.dropbox.com/t/6HAJXVx3YQERD6Jv - krahul57New Member
I mean i want to get all dates from start date and end date into one column.
- tamerj1
Community Champion
krahul57
Here is an example of how to do that by creating a new calculated table usinng GENERATE function. Please note that blanks can create errors iff exist. Usualy if the end date is blank we return TODAY like:
CALENDAR ( Data[Start Date] , COALESCE ( Data[End Date] ), TODAY ( ) ) ). If the start date is blank then you need to decide which date shall be returned (probably the min date available in data).Orders New = SELECTCOLUMNS ( GENERATE ( Orders, CALENDAR ( Orders[Start Date], Orders[End Date] ) ), "Order Number", [Order Number], "Date", [Date] )