Forum Discussion
abegum
4 years agoFrequent Visitor
CLYCLICAL WEEKS IN POWERBI/POWERQUERY
Good day,
I have a list of weeks of the year and I want to group them into groups of 5, for example:
-week 1: 1,2,3,4,5
-week 2: 2,3,4,5,6
The problem I have is that when I get to the last weeks, I w...
- 4 years ago
let Source = {1..53}, #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each List.Range(Source & Source,[Column1]-1,5)), #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}) in #"Extracted Values"How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".
lbendlin
Super User
4 years ago
let
Source = {1..53},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each List.Range(Source & Source,[Column1]-1,5)),
#"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text})
in
#"Extracted Values"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".