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

SQL server import query run 2 times

Hello, I have an issue with Power bi who runs 2 twice a request from sql server.

The time (duration) of importation data from sql server is very long.

In my case I have a request in SQL server, when I run it the duration is 1min30.

When I do the importation in Power Bi desktop, it run the query 2 times (it took 3min in total).

Do you know how to resolve this.

 

Thanks in advance.

 

7 REPLIES 7
Anonymous
Not applicable

Hello lbendlin,

I try it but it doesn't work. In SQL it's turn in 1min30 but in power bi it took 3min

This is my query:

 

let 

Source = Sql.Database("A", "B", [Query=".........."]),
OverrideZeroRowFilter = Table.View(null,[GetType = () =>type table
[cpcpte = Decimal.Type]

, GetRows = () => Source, OnTake
= (count as number) => if count = 0
then #table(GetType(), {})
else Table.FirstN(Source, count)]
),
#"Col rename" = Table.RenameColumns(Source,{{"cpcpte", "cpt"}})

in
#"Col rename"

Don't run a custom query, or mask it with a view.

Anonymous
Not applicable

I don't get it 😬. Could you details more please?

Let Power Query connect to a view in your SQL database.

Anonymous
Not applicable

Okay I understand but in my query I have some parameters so I couln't use a view from SQL database.

Not sure I understand.  Power Query doesn't know that it is talking to a view. Your parameters will work regardless.

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.