Forum Discussion
Pushing Filters to Database for Direct query reports
Good afternoon Forum
I am looking for advice on how I can push metric filters to the Database level for a Direct query model. My solutions is a large composite model for inventory. We snapshot ~20M rows of data per day in this inventory system. Aggregated levels of data perform well since they are imported tables. However we are running into resource constraints when querying this system at the daily level becuase these queries are hitting the database directly and we are running up against the 1M row intermediate table limitation in GEN2. We were able to get around this issue with GEN1 by upping the intermediate table limit. This setting is not available on GEN2. I feel we could get around this error if I could pass metric filters to the database level.
One example is we have a query looking to return store/UPC combinations with overstock of 250 units or more. The query passed to the database returns 3M+ rows and exceeds the 1M row intermediate table limit of GEN2. This is because the query is pulling all store and UPC lvel data into Power BI and then applies the filter to the measure after the data is returned. If the measure filter could be applied to the query and pushed to the database level the returned set is only 13K rows.
Has anyone else run into this issue and did you find a solutions to limit the number of returned from the direct query.
- Anonymous5 years ago
Hi MattKarriker2 ,
In DirectQuery mode the data stays in the database, and isn't loaded into Power BI. But sure, you can filter the table in DirectQuery so long as the filters can be "folded" into a source query.
Please take a look at the following bulleted list to optimize data source performance:
- Ensure data integrity is complete
- Add indexes
- Design distributed tables
- Ensure required data transformations are materialized
- Materialize a date table
Refer to:
DirectQuery model guidance in Power BI Desktop - Power BI | Microsoft Docs
How To Filter Data Before Direct Query From Sql Database In Power Bi
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- parry2kSuper User
MattKarriker2 did you looked at the aggregated tables and see if that can be used here. Use and manage aggregations in Power BI Desktop - Power BI | Microsoft Docs
- AnonymousNot applicable
Hi MattKarriker2 ,
In DirectQuery mode the data stays in the database, and isn't loaded into Power BI. But sure, you can filter the table in DirectQuery so long as the filters can be "folded" into a source query.
Please take a look at the following bulleted list to optimize data source performance:
- Ensure data integrity is complete
- Add indexes
- Design distributed tables
- Ensure required data transformations are materialized
- Materialize a date table
Refer to:
DirectQuery model guidance in Power BI Desktop - Power BI | Microsoft Docs
How To Filter Data Before Direct Query From Sql Database In Power Bi
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.