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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Add custom sequences to table(s)

Hello,

 

here is basically what i'm trying to do in the Power Query Editor:

fgaertne103119_0-1700230198686.png

Basically adding a custom sequence for each Col1/Col2 group. I tried adding "Column from Examples" but it seems to only allow inserting values for up to 100 rows and i have more than that. Also it would be much neater to not type the full sequences by hand but use functions similar to adding a custom incremented index column or using List.Generate() etc.

I Table.Split() my table and end up with a list of tables (each one containing all rows per unique Col1/Col2 group) but this step also would only help me if there is e.g. a way to save each individual table in the list to a complete new table in Power Query or being able to add my custom sequence to each table in the list of tables. Both I couldn't figure out to do?

Maybe someone knows or has an alternative idea?!

 

Best regards

Felix

 

 

4 REPLIES 4
Ahmedx
Super User
Super User

to know how to do this watch my video

[
t1 = List.Generate(()=> 20,
(x)=> x<= 10000000,
(x)=> x+10),
t2 = if Number.IsOdd([Col3]) = true then t1{[Index]} else t1{[Index]-1}*2][t2]

 https://1drv.ms/v/s!AiUZ0Ws7G26Ri3dQ4zKLN05R8b0W?e=NreGXc

Anonymous
Not applicable

I appreciate your help Ahmed. However, if i understand correctly your solution very much restricts the possible sequences generated in the custom column. Thats why in your example (in the video) you have the sequence for Col3 = 1 -> 30, 50, 70, 90 (so always increments of 20). Hence with this method it wouldn't be possible to recreate the exact scenario from my example picture (50, 40, 20, 200). It get's even worse for me since in reality i have a much more extensive table, meaning for Col3 I have values 1-12 instead of my example where there is only 1-2 so just checking for odd / non-odd numbers won't work either. I don't think there is any way to do what i need in a neat and short formula like you provided.

 

I found a way that is tedious which is to right-click on each table in my list of tables and "Add as a New Query". Then i can subsequently add Index columns (with custom increments) in each of the "New Queries". But each query basically requires PBI to load the whole data set which is plain stupid and destroys the report performance..

Ahmedx
Super User
Super User

pls try

Anonymous
Not applicable

I can't open the file due to incompability with the version i'm using. Also I can't update the version due to restrictions within the enterprise. If you can explain (or paste code) I'd appreciate that

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.