Forum Discussion
Turn Start Date & End Date columns into one column with
- Anonymous9 years ago
Hi pierre415,
You can follow below steps to use the query:
1. Click on 'fx' to add custom steps.
Previous step name:
2. Replace bold part with your column names and step name.
=Table.AddColumn(#"Changed Type", "Custom", each List.Dates([StartDate], Duration.TotalDays([EndDate]-[StartDate]), #duration(1, 0, 0, 0))) previous step name startdate enddate startdateRegards,
Xiaoxin Sheng
- Anonymous9 years ago
Hi pierre415,
Click on the arrow button and choose 'expand to new row' option:
Regards,
Xiaoxin Sheng
Hi pierre415,
You can follow below steps to use the query:
1. Click on 'fx' to add custom steps.
Previous step name:
2. Replace bold part with your column names and step name.
=Table.AddColumn(#"Changed Type", "Custom", each List.Dates([StartDate], Duration.TotalDays([EndDate]-[StartDate]), #duration(1, 0, 0, 0)))
previous step name startdate enddate startdate
Regards,
Xiaoxin Sheng
- pierre4159 years ago
Helper I
Thanks a lot Xiaoxin, I can't tell you how much this helps. Just one more question: how do I expand my date lists so that each row shows a date?
Thanks
Pierre - ajrajes8 years agoFrequent Visitor
Amazing - you made my day!! Thank you.
- Anonymous5 years agoNot applicable
Anonymous
Thank you so much for your simple solution, still using in 2021. I have a follow-up question. I did the same but I get the date that has a date range, How do I fill out nulls with the start date? Please see below, and I am not familiar with Power Query. Thank you so much= Table.AddColumn(#"Renamed Columns", "Custom", each List.Dates([Start], Duration.TotalDays([End]-[Start]), #duration(1, 0, 0, 0)))- Jakinta5 years ago
Solution Sage
= Table.AddColumn(#"Renamed Columns", "Custom", each if [Start]=[End] then {[Start]} else List.Dates([Start], Duration.TotalDays([End]-[Start]), #duration(1, 0, 0, 0)))- Anonymous5 years agoNot applicable
Jakinta Thank you so much. I really appreciate that this is what I exactly want.