Forum Discussion

Mage's avatar
Mage
Frequent Visitor
1 year ago

Calculate Date in Power Query

Hi,

Suppose 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 5rd weekday(End Day) each week originally. I want to transform them to concrete Start Dates and End Dates in the table by creating custom columns.

 

However, it will not be handled on the day IsLeave = 1. For example, in a week from 2024/12/30 to 2025/1/5, the original Start Date should be 2024/12/30, it delayed to 2024/12/31 due to 12/30 IsLeave = 1. In addition, the original End Date should be 2025/1/3, it delayed to 2025/1/7 due to 4 days leave in a week. So the expected output table may like:

How can I arrive it in Power Query, thanks a lot

 

Regards

1 Reply