Forum Discussion
Mage
1 year agoFrequent Visitor
Loop in Power Query to get date
Hi, Basically I have a weekly plan through a whole month, the table may like this: The plan will be handled from 1st weekday(Start Day) to 4rd weekday(End Day) each week, I want to transform ...
Omid_Motamedise
1 year agoSuper User
You do not need loop in this case, and you can easily solve it bu using the next code
let
Source = Table.FromColumns({List.Dates(#date(2024,7,1),31,#duration(1,0,0,0))},{"Date"}),
#"Added Custom" = Table.AddColumn(Source, "Start Date", each Date.StartOfWeek([Date])),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "End Date", each Date.StartOfWeek([Date])+#duration(3,0,0,0))
in
#"Added Custom1"
in another casaes, if you need loop, check this video
https://www.youtube.com/watch?v=G8PRbWuDcmQ&t=12s