Forum Discussion
Anonymous
2 years agoNot applicable
Generating a table from fixed parameters
Hello, I am trying to create a table like the following that will be used as X-axis for other Y-axis table data I have (also seven columns). 1 17 33 49 65 81 97 2 18 34 50 66 82 9...
- 2 years ago
try this final code
danextian
2 years agoSuper User
Hi Anonymous ,
If you are trying to create a data table using those parameters, try this:
let
Source = {1..(RowCount * ColumnCount)},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Inserted Integer-Division" = Table.AddColumn(#"Converted to Table", "IntegerDivision", each Number.IntegerDivide([Column1]-1, RowCount) + 1, Int64.Type),
#"Changed Type" = Table.TransformColumnTypes(#"Inserted Integer-Division",{{"Column1", type text}}),
Custom1 = Table.FromColumns( List.Transform( {1..ColumnCount}, (x)=> let
t = Table.SelectRows(#"Changed Type", each [IntegerDivision] = x)[Column1]
in t
), {"1"..Text.From(ColumnCount)})
in
Custom1
Make sure to create these parameters:
ColumnCount = 7
RowCount = 32
Interval = 16
- Anonymous2 years agoNot applicable
Hey, the output you have is different than what I shared.
- Ahmedx2 years agoSuper User
pls try cod power query