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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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

2 REPLIES 2
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!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors