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
ak77
Post Patron
Post Patron

Direct Query Performance

Hi All,

 

i need a help for an existing direct query power bi dashboard.

 

The direct query uses PortfolioCodeParameter as input for the selected PortfolioCode from dashboard and gets the data from a sql.

table.. The total records retrieved once is around 500,000(1/2 million)  and there are 10 measures that are being calculated once data is retrieved,

 

The entire process of completion is taking around 40 seconds..  is there a way to or any settings to improve the performance of this direct query? Please help

 

[Query="SELECT [Level_Code]#(lf) ,[NODE_NAME]#(lf) ,[HEX_VALUE]#(lf) ,[portfolio_code]#(lf)
,[date_from]#(lf) ,[sequence]#(lf)
,[log_portfolio_base]#(lf) ,[log_contribution_base]#(lf)
FROM [look_through_temp_dashboard]

where portfolio_code='" & PortfolioCodeParameter & "'"]

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

 

The total records retrieved once is around 500,000(1/2 million)  and there are 10 measures that are being calculated once data is retrieved,

 

No, not once.  EVERY. SINGLE. TIME.  a user interacts with the report element that uses that data source.

 

Note that there is a hard 1M row limit for Direct Query result sets. You are already at half that limit.  You will want to consider aggregating your data at the source to drastically reduce the amount of data traveling over the nework for each query. 

 

At a minimum you will want to put an index on portfolio_code and make sure the statistics are kept up to date. However you will also want to examine the actual SQL query and add more indexes accordingly.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

 

The total records retrieved once is around 500,000(1/2 million)  and there are 10 measures that are being calculated once data is retrieved,

 

No, not once.  EVERY. SINGLE. TIME.  a user interacts with the report element that uses that data source.

 

Note that there is a hard 1M row limit for Direct Query result sets. You are already at half that limit.  You will want to consider aggregating your data at the source to drastically reduce the amount of data traveling over the nework for each query. 

 

At a minimum you will want to put an index on portfolio_code and make sure the statistics are kept up to date. However you will also want to examine the actual SQL query and add more indexes accordingly.

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.