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
Bebs
Helper II
Helper II

Is there a way to limit the number of lines loaded for a csv

Hi,
I'm working in PowerBI with several big csv files including a 7Go csv File. It works, but for development, is there a command, an option, or something to add in :

= Csv.Document(File.Contents("E:\myfile.csv"),[Delimiter=",", Columns=10, Encoding=65001, QuoteStyle=QuoteStyle.None])
To limit the number of loaded lines (exemple : 10 000).

 

To develop the power Query part, I don't need to load the full data set. And with the full set of data, it takes forever to apply any modifications in Power Query

 

Thanks

1 ACCEPTED SOLUTION
m_dekorte
Super User
Super User

Hi @Bebs,

 

There is no parameter to control the number of rows for Csv.Document BUT  you can use Keep Rows on the Home tab to limit the number of rows by keeping only the top, bottom or a range of rows as first transformation. Once development is done, you can delete that transformation step.

Alternatively, you can utilize R or Python to create a dataframe from the CSV but that is not native to M.


I hope this is helpful

View solution in original post

1 REPLY 1
m_dekorte
Super User
Super User

Hi @Bebs,

 

There is no parameter to control the number of rows for Csv.Document BUT  you can use Keep Rows on the Home tab to limit the number of rows by keeping only the top, bottom or a range of rows as first transformation. Once development is done, you can delete that transformation step.

Alternatively, you can utilize R or Python to create a dataframe from the CSV but that is not native to M.


I hope this is helpful

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.