我有一个带有日期列的日期表。我想每个月都有一个周期。到目前为止,我已经构建了一个自定义列,以便每个周期从星期一开始,到星期日结束:
let
startOfWeek = Date.StartOfWeek([Date]),
endOfWeek = Date.EndOfWeek([Date]),
yearOfStartOfWeek = Date.Year(startOfWeek),
yearOfEndOfWeek = Date.Year(endOfWeek),
valueToReturn = if yearOfStartOfWeek = yearOfEndOfWeek then
Text.From(Date.StartOfWeek([Date])) & " - " & Text.From(Date.EndOfWeek([Date]))
else
Text.From(Date.StartOfWeek([Date])) & " - " & Text.From(Date.EndOfWeek(endOfWeek))
in valueToReturn
但我需要的是这种每周周期的方式: