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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

restrict loading of dataset

Can i restrict number of rows to load in dataset by applying where clause.

Requirement is i dont want complete data to be imported in pbix but need data for 10 clients only.

 

Instead of applying where clause in sql end, can i do something at pbix end so it doesnt load all clients data?

 

Kindly help.

2 ACCEPTED SOLUTIONS
Stachu
Community Champion
Community Champion

if you filter the customers within the PowerBI interface, it should apply query folding to apply the filter
https://blog.crossjoin.co.uk/2017/06/11/query-folding-and-writing-your-own-sql-queries-in-power-quer...

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

In Option 2, your entire data is brought in, Only after that your filters are applied. In Other Words, Your report will have all clients information, but your visuals will get only the restricted clients information as you are applying the filters to your dataset before using in Visuals

 

Yes you can see the datset size in your Group Storage Section. Find below the image

storage.PNG

 

 

Clicking on this, will display all the information related to the data sets

View solution in original post

8 REPLIES 8
Abhilash7181
Frequent Visitor

In Option 2, the entire dataset is first loaded into Power BI, and then filters are applied at the visual level. This means that while the report contains all client data, only the restricted client information appears in the visuals.

However, loading the full dataset before filtering can impact performance, especially with large datasets. A more optimized approach is to apply filtering at the source level using a SQL query before loading data into Power BI. This reduces the dataset size and improves report performance.

For example, instead of bringing in all client data and filtering later, you can use a SQL query with a WHERE condition to load only the required data:
SELECT *
FROM Clients
WHERE Region = 'West' -- Load only data for the 'West' region

This ensures that only relevant data is imported, leading to faster refresh times and improved report efficiency.

Regarding dataset size, you can check it in the Group Storage Section in Power BI Service, where it provides details on how much space your dataset occupies. Below is an image showing where you can find this information.

Stachu
Community Champion
Community Champion

if you filter the customers within the PowerBI interface, it should apply query folding to apply the filter
https://blog.crossjoin.co.uk/2017/06/11/query-folding-and-writing-your-own-sql-queries-in-power-quer...

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Hi @Anonymous,

Yes you can filter the data set in PBIX Power Query window which you get when you click on edit Queries, just like the way you do in excel.

 

Click on the column drop down and filter the items that you want

Anonymous
Not applicable

Hi, 

There are two options available.Not able to understand consequences of each.

Which one should i prefer.

 

Option 1: Writing sql while importing my view in power bi desktop with where clause.What impact will it have to performance since it stops query folding.

 

Option 2: to apply select specigif id from columns populating in edit queries?Will it not pull all data from sql server and then apply filter?

Hi @Anonymous,

I would say Option 1 is the better approach of the two specified.

 

In Option 1, your data will be restricted even before it is imported to your report. In this means, you can restrict the volume of data getting imported in Import Mode. In case of Direct Query, it will certainly improve performance as compared to applying filter in Power BI, as every time your query runs the query is applied on the entire table to which it is connected to

 

In your Oprion 2, as you say, even if you filter for specific id in the Edit Queries Window, the Filters will be applied only after the entire data is pulled in to the report

Anonymous
Not applicable

I doubt based on blog shared above.If we need to limit data in dataset, we can opt for option 2.

I am confused that if i will publish this dashboard on service, will dataset hold all clients infotrmation or only those which are filtered out.

 

Continuation to this can we see dataset size which we publish on workspace, individually.

In Option 2, your entire data is brought in, Only after that your filters are applied. In Other Words, Your report will have all clients information, but your visuals will get only the restricted clients information as you are applying the filters to your dataset before using in Visuals

 

Yes you can see the datset size in your Group Storage Section. Find below the image

storage.PNG

 

 

Clicking on this, will display all the information related to the data sets

Anonymous
Not applicable

Thanks alot for help

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.