Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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).

1173349658197
2183450668298
3193551678399
42036526884100
52137536985101
62238547086102
72339557187103
82440567288104
92541577389105
102642587490106
112743597591107
122844607692108
132945617793109
143046627894110
153147637995111
163248648096112
113129145161177193209
114130146162178194210
115131147163179195211
116132148164180196212
117133149165181197213
118134150166182198214
119135151167183199215
120136152168184200216
121137153169185201217
122138154170186202218
123139155171187203219
124140156172188204220
125141157173189205221
126142158174190206222
127143159175191207223
128144160176192208224


So, as you can see the numbering start from 1, goes down 16 rows and then jump to column 2 with the value 17 and so on. Can I create a table in Power BI Desktop that generates this table from me based on the parameters I provide. The parameters will be mainly the window (in this case 16) ,the number of columns and rows. Thanks a lot.

7 Replies

  • Hi Anonymous 

     

    If this table will never change, you could copy and paste from Excel to "Enter Data".

    • Anonymous's avatar
      Anonymous
      Not applicable

      This works but it's very manual. Thank you for your help.

  • 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