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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
tex628
Community Champion
Community Champion

Performance issues

While trying to change a source in the query editor im getting extreme performance issues that i can not really explain:

image.pngimage.pngimage.png

I've always had the maximum amount of cashed ram in PBI to 4GB:



All that i am doing is changingthe source of this working SQL query:

let
  Source = Sql.Databases("[SQL Server]"),
  Step 1 = Source{[Name = [Database]]}[Data],
  #"Filtered Rows" = Table.SelectRows(Step 1, each Text.EndsWith([Name], "$Sales Invoice Line")),
    #Step 2 = #"Filtered Rows"{[Schema="dbo",Item="Company$Sales Invoice Line"]}[Data],
    #"Sorted Rows1" = Table.Sort(Company$Sales Line",{{"Shipment Date", Order.Descending}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Sorted Rows1",{"Document No_", "Amount", "Shortcut Dimension 1 Code", "Posting Date"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Posting Date", type date}}),
    #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each Date.IsInPreviousNMonths([Posting Date], 3) or Date.IsInCurrentMonth([Posting Date])),
    #"Appended Query" = Table.Combine({#"Filtered Rows1", #"Sales Cr_Memo Line"})
in
    #"Appended Query"

To dataflows:

let
    Source = PowerBI.Dataflows(null),
    #"ID" = Source{[workspaceId="ID"]}[Data],
    #"ID2" = #"ID"{[dataflowId="ID2"]}[Data],
    #"Sales Invoice Line1" = #"ID2"{[entity="Sales Invoice Line"]}[Data],
    #"Sorted Rows1" = Table.Sort(#"Sales Invoice Line1",{{"Shipment Date", Order.Descending}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Sorted Rows1",{"Document No_", "Amount", "Shortcut Dimension 1 Code", "Posting Date"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Removed Other Columns",{{"Posting Date", type date}}),
    #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each Date.IsInPreviousNMonths([Posting Date], 3) or Date.IsInCurrentMonth([Posting Date])),
    #"Appended Query" = Table.Combine({#"Filtered Rows1", #"Sales Cr_Memo Line"})
in
    #"Appended Query"

Does anyone have any idea as to what is causing this?


Connect on LinkedIn
2 ACCEPTED SOLUTIONS
tex628
Community Champion
Community Champion

Hi @Mariusz!

I managed to figure out what caused all of this.
As you can see in the queries below there is a step where i sort decending on shipment date.

After taking a closer look i noticed that in the SQL query the datatype was DateTime while in dataflows it was string. 
Removing the sorting step loaded the query instantly. 

This is a little worrying. I don't quite understand how that can be the cause...

/ J
 


Connect on LinkedIn

View solution in original post

Mariusz
Community Champion
Community Champion

Hi @tex628 

 

Glad you worked it out, all the best.

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @tex628 

 

My guess is that a lot of processing has been happening on SQL server end ( Query Folding ), where when you change to dataflows, all is done locally.

 

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski


  

tex628
Community Champion
Community Champion

Hi @Mariusz!

I managed to figure out what caused all of this.
As you can see in the queries below there is a step where i sort decending on shipment date.

After taking a closer look i noticed that in the SQL query the datatype was DateTime while in dataflows it was string. 
Removing the sorting step loaded the query instantly. 

This is a little worrying. I don't quite understand how that can be the cause...

/ J
 


Connect on LinkedIn
Mariusz
Community Champion
Community Champion

Hi @tex628 

 

Glad you worked it out, all the best.

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors