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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
ivy8252003
Frequent Visitor

Apply Query Changes ran multiple times

Hi all,

 

I'm loading a simple query like "select * from view_" (over 4 million rows in total) from SQL server in PowerBI Desktop and it runs multiple times. I've tested with a subset of that view, it just ran once. Is it just a matter of the size of the dataset? Is there any way to prevent it from running multiple times? Any solutions? 

 

Thanks,

Ivy

1 ACCEPTED SOLUTION
ivy8252003
Frequent Visitor

Well, I removed the two "rename columns" steps and then refreshed the report, it only ran once.  Not sure if this was the reason for loading data twice, but if you come across the same issue, it's worth giving it a try.

View solution in original post

4 REPLIES 4
ivy8252003
Frequent Visitor

Well, I removed the two "rename columns" steps and then refreshed the report, it only ran once.  Not sure if this was the reason for loading data twice, but if you come across the same issue, it's worth giving it a try.

v-alq-msft
Community Support
Community Support

Hi, @ivy8252003 

 

Based on your description, I think your query should run once. It is possible that Power Query try to get the type of data according to the first 1k rows. You may try to go to 'File'-'Options'-'Current File'-'Data Load', uncheck 'Automatically detect column types and headers for unstuctured sources'.

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

Hmm, not enough info to go on here, why do you think it is running multiple times, what does your query look like? Paste the M code from Advanced Editor.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

I saw it loading up to 4.5 million rows and then back to 1k rows.... 

Here is the M code:

let
Source = Sql.Database("SQL03", "EDM", [Query="SELECT * FROM vw_Sales"]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Master Account No", Int64.Type}}),
#"Rename Columns" = Table.RenameColumns( #"Changed Type", List.Zip({tHeaderConversion[New columns], tHeaderConversion[Old columns]})),
#"Rename Columns Rev" = Table.RenameColumns( #"Rename Columns", List.Zip({tHeaderConversion[Old columns], tHeaderConversion[New columns]})),
#"Renamed Columns" = Table.RenameColumns(#"Rename Columns Rev",{{"Adj cCOGS Ledger Currency", "Adj cCOGS Ledger Currency_o"}, {"Adj Gross Sales Ledger Currency", "Adj Gross Sales Ledger Currency_o"}, {"cCOGS Adjustment Ledger Currency", "cCOGS Adjustment Ledger Currency_o"}})
in
#"Renamed Columns"

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.