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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

I need to import only a sample of a large database

Hello,

 

I have a very large csv database and I'd like to import only 10% of the observations, keeping all the columns and variables the same. Is there a way to randomly select and load a sample of the database? Thank you. 

1 ACCEPTED SOLUTION
MAwwad
Solution Sage
Solution Sage

Yes, you can use Power BI to randomly select and load a sample of your database. Here's one way to do it:

  1. In Power BI Desktop, select "Get Data" from the Home ribbon and then select "Text/CSV" as the data source.

  2. In the "Import Data" dialog, select your CSV file and then click "Transform Data".

  3. In the Query Editor, click the "Sample" button in the "Transform" tab of the ribbon.

  4. In the "Sample" dialog, select the "Sample Size" option and enter the percentage of the data you want to load, for example 10%. Make sure the "Use first row as headers" option is checked.

  5. Click "OK" to apply the sample.

  6. Click "Close & Apply" in the Query Editor to load the data into Power BI.

This will load a randomly selected sample of your data into Power BI, keeping all the columns and variables the same.

View solution in original post

3 REPLIES 3
MAwwad
Solution Sage
Solution Sage

Yes, you can use Power BI to randomly select and load a sample of your database. Here's one way to do it:

  1. In Power BI Desktop, select "Get Data" from the Home ribbon and then select "Text/CSV" as the data source.

  2. In the "Import Data" dialog, select your CSV file and then click "Transform Data".

  3. In the Query Editor, click the "Sample" button in the "Transform" tab of the ribbon.

  4. In the "Sample" dialog, select the "Sample Size" option and enter the percentage of the data you want to load, for example 10%. Make sure the "Use first row as headers" option is checked.

  5. Click "OK" to apply the sample.

  6. Click "Close & Apply" in the Query Editor to load the data into Power BI.

This will load a randomly selected sample of your data into Power BI, keeping all the columns and variables the same.

Anonymous
Not applicable

Hi, thank you for your response.

 

I have followed your steps but I don't seem to find the "Sample" button in the transform tab in the query editor. Could you attach a screenshot of it?

 

Thank you!

I don't see a "Sample" button either... 3 years later... 🤣

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.