Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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 them to concrete Start Dates and End Dates in the table by creating custom columns. The expected output may like:
How can I arrive it in Power Query instead of using DAX, perhaps it needs to be loopped but it confused me a lot.
Regards
Solved! Go to Solution.
Hi @Mage
Start Date
Date.AddDays(Date.StartOfWeek([Date],0),[Start Day])
End Date
Date.AddDays(Date.StartOfWeek([Date],0),[End Day])
Stéphane
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
Hi @Mage
Start Date
Date.AddDays(Date.StartOfWeek([Date],0),[Start Day])
End Date
Date.AddDays(Date.StartOfWeek([Date],0),[End Day])
Stéphane
Thank you for the help, it reminds me a lot, but the actual will be more complex, I will post a new thread.
Regards
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |