Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not 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).

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.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

try this final  code

Screenshot_5.png

 

View solution in original post

7 REPLIES 7
Ahmedx
Super User
Super User

try this final  code

Screenshot_5.png

 

danextian
Super User
Super 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

 

danextian_0-1701664367321.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hey, the output you have is different than what I shared.

pls try cod power query

 

Ahmedx
Super User
Super User

pls try

Screenshot_1.png

Anonymous
Not applicable

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

gmsamborn
Super User
Super User

Hi @Anonymous 

 

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



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.