Hi, I am looking to create a column that will flag nth dates in a recuring 7 day period. For example the 4 days in a first 7 day period, 4 days in the next 7 day period etc etc. It can flag the first 4 days or the last 4 days or any 4 days in the 7 day period it does not matter
A pattern does not need to complete
In the sample code below there are 3 id's with differing date ranges and DaysPerWeek values. I have created an ExpectedFlag column to show the required outcome
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lde9agMxEEXhd9naYM3V/pYuQnCRkEAgBOPObaq8P8SLG+8Ud3UMLgxfIfasZM3l0pUyftayfur32+/f+fTaHbrh/i1xLMNRReuPn+56cFbAVmB7YAdgxyf7vmMnYGewhqXdRgEWdAvQLWr7c4geWNAtRmAnYEG3AN1U2p+DAljQTWC/Cew3gW4C3QT2m2ZgQbcK9lsl5+TdjuBMbbb1ye6dUT2wg13Dx3J72Gl/vVtbge2BJesdgZ2AnYFd2u36H9Bs/Xu2taBbgG4BugXoFqBbgG4BugXoJtBNoJtAN4FuAt0Eugl0E+gm0E2gWwXd1nN9Audks63A9sAOwI7O3r6k8+llfV7d3hyQrL2XJGvvJckO7k6QrJ0DkrX3kmTtvSRZey/ZWj8HJGvvJcmqfb1+DkjWzgHJgm5+DkjWzgHJ2jkg2aV9vX4OSNbOAcmCbn4OSBbsNz8HJAv2m58DkgX7TaCbnwOSTfvt+g8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, DaysPerWeek = _t, HeadcountDate = _t, #"Expected Flag" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Id", type text}, {"DaysPerWeek", Int64.Type}, {"HeadcountDate", type date}, {"Expected Flag", type text}})
in
#"Changed Type"
Any help will be much appreciated
Thanks