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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
thiagogouveiar
Frequent Visitor

Problem to import data from SQL Server View

Hi,

 

I've all my data in Azure SQL Server and I created some views to use in Power BI Desktop. However, when I create a view with some calculations (e.g. groupby) in SQL Server Management, Power BI cannot import the data:

 

Failed to save changes to server. Error returned: "OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: Query timeout exceeded.
".

 

Some disclaimers:

1) Power BI works for this view when I use Direct Query

2) For simpler views (just selecting some columns from a table), it´s possible to import data

 

SQL CODE to create a view:

 

CREATE VIEW marketing.Leads5 AS
        SELECT DISTINCT (l.Email) AS [Email Lead]
        , l.Cargo AS Cargo
        , l.ID_lead as id_lead
        , l.Empresa as Empresa
        , l.Funcionários as [Tamanho da Empresa]
        , l.Segmento as Segmento
        , l.Website as [Site da Empresa]
         , COUNT(c.Identificador) as Conversões
FROM dbo.leads l
LEFT JOIN dbo.conversions c
ON l.Email = c.Email
GROUP BY l.Email, l.Cargo, l.ID_lead, l.Empresa , l.Funcionários , l.Segmento, l.Website

 

Could anyone help me with this issue?

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

Hi,

 

There are many factors which can cause the query timeout, data amount, network, etc. In this scenario, I suggest you separate the view into multiple views and only import useful columns. See: https://www.sqlbi.com/articles/data-import-best-practices-in-power-bi/

 

Also you can set the timeout property in Power Query within Advanced Editor.

 

For more details, please see: https://blog.crossjoin.co.uk/2014/09/29/advanced-options-for-loading-data-from-sql-server-with-power...

 

Regards,

Simon Hou

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.