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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
kroman
Helper II
Helper II

Getting sorted data in bunches

Hi All

We have a dataset with 100K rows in the following format:

kroman_0-1688044148332.png

And we have a flow that is getting data from this dataset

Due to the fact that flow cannot get all 100k rows in one go we are getting it in bunches of 25k rows, using autoincremented index, after that we are creating csv file from it - no problems so far.

kroman_1-1688044438021.png

 

But we also need to be able to sort  data by any of those columns and then get data in 25k rows bunches, so we cannot use min-max ID for that any more 😞 , and becouse we have a lots of columns, creating index for each column is not an option, all to be done dynamically.
 So the question is - how can we get 100k rows of dynamicaly sorted data from dataset into flow ?

Thanks

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could use the WINDOW function, that allows you to order by whichever column you want and you can provide the offsets you need.

View solution in original post

7 REPLIES 7
johnt75
Super User
Super User

You could use the WINDOW function, that allows you to order by whichever column you want and you can provide the offsets you need.

Finaly works with 

WINDOW(0, REL, 10 , ABS 

 

Thanks for your reply     

  I am trying it with WINDOW with following query on a 100 rows table

     EVALUATE  
         VAR Window1 =  WINDOW(1, REL, 5 , REL, Data100Rows, MATCHBY([Index]))
    RETURN Window1

 

But it returns all 100 rows instead of 5 rows

I think it wants to be ABS, not REL

EVALUATE
VAR Window1 =
    WINDOW ( 1, ABS, 5, ABS, Data100Rows, MATCHBY ( [Index] ) )
RETURN
    Window1

kroman_0-1688133084644.png

😪

If you're getting all the data each time, does it matter what order it is in ? Also, have you considered using a Live Connected xlsx file rather than exporting to CSV ?

100 rows is just for testing
we have a 200k rows dataset which we need to convert into csv with a Flow (powerautomate), and flow can only take 25-30k rows in one go, so I am doing some looping to get all the data. But we also need to sort that data by different columns before getting it to csv 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.