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
MarieD
Helper I
Helper I

Limited load from data souce

Hi all,

 

I'm new to PowerBI and want to make reports from a Magento Database. the connection has already been set up by using Mysql connection, but the problem is that there are a lot of rows in the database and PowerBI Desktop has problems with reloading and refreshing.

Now as I'm still working on my model and visuals, i want Power BI to load only top 1.000 rows from the database. Is there a way this can be done? I've read topis about adding a SELECT statement, but I;m now sure how and where i must add this? It looks now that is is filtered by date but even then there are over 1.000.000 rows.

 

This is the first part of the query:

 

let
Source = MySQL.Database("00.000.000.00:0000", "XXXX_m2_production", [ReturnSingleDatabase=true]),
XXX_m2_production_sales_order_item = Source{[Schema="XXXX_m2_production",Item="sales_order_item"]}[Data],
#"Filtered Rows" = Table.SelectRows(XXXX_m2_production_sales_order_item, each [created_at] >= #datetime(2019, 1, 1, 0, 0, 0)),

 

It would be great if somebody can help me with this!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You could do it with an SQL statement but it is easier to use Keep Rows in the query editor.  In your query, click on your 2nd step or on the Filtered Rows step, and on the Home tab click on KeepRows/Keep Top Rows.  Put in 1000 in the popup and it should add a Keep Rows step.  That way, query folding should still occur.

 

When you are done with your query building, you can just remove that step to get all the data when you need that.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @MarieD 

 

I'd like to suggest you use 'Filter rows' feature to filter out the data youwant. Or you can do the filter when you connect to the database. I created data to reproduce your scenario.

Testalq:

 

e1.png

 

You may use filter rows to filter out the result as below.

e2.png

 

Then you can right-click the step 'Filter Rows', click 'View native query', copy the codes.

e3.png

 

Then you can create a new query, click 'Advanced options', paste the codes in 'SQL statement'.

e4.png

 

Result:

e5.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many thanks for your help!! 

 

mahoneypat
Microsoft Employee
Microsoft Employee

You could do it with an SQL statement but it is easier to use Keep Rows in the query editor.  In your query, click on your 2nd step or on the Filtered Rows step, and on the Home tab click on KeepRows/Keep Top Rows.  Put in 1000 in the popup and it should add a Keep Rows step.  That way, query folding should still occur.

 

When you are done with your query building, you can just remove that step to get all the data when you need that.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you Pat!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.