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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
mike_asplin
Helper IV
Helper IV

Very strange behaviour on refresh on pbix or online not picking up data

I've never seen this before.

 

I am using a gateway to access a clients SQL server. Recently we recreated some views of table as pulling in the tables themselves ran out of resources in Power BI. These views are calculated overnight

 

in my pbix if i edit the query and sort the data in descending date order I can see data from 1/3/26.  However if I refresh the model I'm not getting anything after 26/2/26? Same thing online.  Sometimes I get a day extra in pbix. Maybe later I will get some or all of the data, but each morning its always wrong. 

 

Is there some strange thing going on with the gateway that it is taking a very long time for the data on the server to reach the gateway? Why can I see preview data, but not actually load it? 

 

Any advice appreciated as cant make sense of it!!!

 

12 REPLIES 12
v-sgandrathi
Community Support
Community Support

Hi @mike_asplin,

 

From what you've described, the source SQL view and gateway connection seem fine, since the single table linked to the view refreshes and shows the latest data in both Desktop and Service. This means Power BI can retrieve up-to-date data from the source. The issue appears after loading individual queries, specifically in the combined query that uses Table.Combine along with other transformations and joins.

Operations like Table.Combine, NestedJoin, and custom columns can break query folding. When that happens, Power BI fetches the data first and then processes transformations locally. Power Query preview might show the latest rows because it loads only a sample, while the full refresh processes everything, including all steps. If joins or transformations reference intermediate queries that haven’t refreshed or contain cached results, the final combined table may show older data even though the base query has the latest rows.

Since your tests show the individual view query loads new data but the combined table doesn’t, the issue likely lies in the transformation logic after combining, not the SQL source. For troubleshooting, try creating a simplified combined query with just the Table.Combine step and check if the latest rows appear. If so, the joins or downstream steps are probably preventing a proper refresh.

To improve refresh reliability, apply filters like [Contact Date] > Loaddate early in each source query before combining, and move join or transformation logic to the SQL layer where possible. This helps maintain query folding, reduces local processing, and can prevent inconsistent refreshes like what you’re seeing now.

 

Thank you.

v-ssriganesh
Community Support
Community Support

Hello @mike_asplin,

We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.

Thank you.

No still compeltely stuck. 

 

So i changed the import to a direct query of Server like this

 

let
    Source = Sql.Databases("PRD-SO-DW2.iia-cloud.com"),
    BT_DW_REPORTING = Source{[Name="BT_DW_REPORTING"]}[Data],
    dbo_v_Contact_Count_Expanded = BT_DW_REPORTING{[Schema="dbo",Item="v_Contact_Count_Expanded"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(dbo_v_Contact_Count_Expanded,{{"Contact Date", type datetime}}),
    #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each [Contact Date] > Loaddate),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows1",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Adviser", "Client Name", "EMAIL"}),
    #"Sorted Rows2" = Table.Sort(#"Removed Other Columns",{{"Case Number", Order.Ascending}}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Sorted Rows2",{{"Contact Date", type date}, {"Contact Time", type time}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type2", "ContactTimeKey", each Text.Replace(Text.From([Contact Time], "en-GB"), ":", "")),
    #"Sorted Rows" = Table.Sort(#"Added Custom",{{"Contact Date", Order.Descending}}),
    #"Lowercased Text" = Table.TransformColumns(#"Sorted Rows",{{"EMAIL", Text.Lower, type text}})
in
    #"Lowercased Text"

 instead of using the query. This made no difference overall

 

However this single table seems to load into the model with the latest data.

 

 so the issue seems to be combining the tables with this query. Mostly this is just combining the tables , editing the emails as some have changed and then looking up their userid by email.  Is this causing a query folding issue?

let
    Source = Table.Combine({#"SLAs Sainsburys", #"SLAs BT", #"SLAs Currys", #"SLAs JLR", #"SLAs Barclays", #"SLAs Stark", #"SLAs Starbucks", #"SLAs NR",  #"SLAs Maximus"}),
    #"Filtered Rows1" = Table.SelectRows(Source, each ([EMAIL] <> null) and ([Contact Type] <> "Inbound Call")),
    #"Merged Queries1" = Table.NestedJoin(#"Filtered Rows1", {"EMAIL"}, Email_Change, {"Old"}, "Email_Change", JoinKind.LeftOuter),
    #"Expanded Email_Change" = Table.ExpandTableColumn(#"Merged Queries1", "Email_Change", {"New"}, {"New Email"}),
    #"Added Custom1" = Table.AddColumn(#"Expanded Email_Change", "Email", each if [New Email]<>null then [New Email] else [EMAIL]),
    #"Removed Other Columns1" = Table.SelectColumns(#"Added Custom1",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Adviser", "Client Name", "ContactTimeKey", "Email"}),
    #"Merged Queries" = Table.NestedJoin(#"Removed Other Columns1", {"Email"}, PhoneUser, {"Username"}, "PhoneUser", JoinKind.LeftOuter),
    #"Expanded PhoneUser" = Table.ExpandTableColumn(#"Merged Queries", "PhoneUser", {"Name", "AdviserId"}, {"Name", "AdviserId"}),
    #"Added Custom" = Table.AddColumn(#"Expanded PhoneUser", "Check", each if Text.Contains([Email],"adviserplus.com") then "Y" else "N"),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Check] = "Y")),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Client Name", "ContactTimeKey", "Name", "AdviserId", "Email"}),
    #"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"Contact Date", Order.Descending}})
in
    #"Sorted Rows"

Overnight the service has correctly refreshed the single table, but the combined table still refuses to update in either service or manaully?  I am completely out of ideas as makes no sense. 

v-ssriganesh
Community Support
Community Support

Hi @mike_asplin,
Thank you for posting your query in the Microsoft Fabric Community Forum.

your SQL shows WHERE 'Contact Date' >= .... In SQL Server, single quotes indicate a string literal, so the column should be referenced as [Contact Date]. If single quotes are being used, the filter may not behave as intended.

To improve reliability:

  • Apply the date filter once.
    • Consider connecting directly to the view to allow Power BI to manage folding
    • Use “View Native Query” to confirm folding is occurring

Please refer the official doc: Query folding guidance in Power BI Desktop - Power BI | Microsoft Learn
Thanks, @rohit1991 for sharing valuable insights.

Best regards,
Ganesh Singamshetty.

Hi Ganesh

 

I've change all the filters to [], but that is only controlling the first and date and its the current data i am struggling with. If I hit the pbix several times eventually it loads, but the online version is stuck

 

What do you mean by directly connect to the view?

 

also what do you mean by "View Native query"?

 

Thanks for your help

 

Hello @mike_asplin,

By connecting directly to the view, I mean selecting the view itself when connecting to SQL Server instead of writing a custom SQL statement using the Query= option. For example, in Get Data → SQL Server, connect to the database and then choose the view v_Contact_Count_Expanded from the navigator. This allows Power BI to control the query and apply query folding automatically.

Regarding View Native Query, this option lets you check whether Power BI is still able to push transformations (such as filters) back to SQL Server. In Power Query Editor, right-click on a step in the Applied Steps pane and select View Native Query. If the option is enabled, it means the step is still folding to SQL; if it is greyed out, the query folding has been broken and Power BI will process that step locally.

vssriganesh_0-1772722576830.png

 

I tried this and made no difference. Stil lcant get the most recent data that i see in preview to populate the modle either locally or in the service. 

rohit1991
Super User
Super User

Hii @mike_asplin 

 

This is almost certainly not a gateway delay issue. If you can see the latest data in Power Query preview but it disappears after refresh, the problem is usually caused by filters, parameters, incremental refresh, or query folding differences during full model load. Preview only shows a sample, while refresh executes the full query logic against SQL.

Most common causes:

  • A date filter or parameter limiting rows (e.g., RangeStart/RangeEnd).

  • Incremental refresh policy excluding recent dates.

  • A query step breaking folding, causing SQL to return different results on full refresh.

  • The SQL view itself updating after your refresh runs (timing issue overnight).

Check incremental refresh settings, confirm no hidden date filters, and test the final native SQL query via View Native Query to validate what is actually being sent to SQL during refresh.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

So i changed the import to a direct query of Server like this

 

let
    Source = Sql.Databases("PRD-SO-DW2.iia-cloud.com"),
    BT_DW_REPORTING = Source{[Name="BT_DW_REPORTING"]}[Data],
    dbo_v_Contact_Count_Expanded = BT_DW_REPORTING{[Schema="dbo",Item="v_Contact_Count_Expanded"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(dbo_v_Contact_Count_Expanded,{{"Contact Date", type datetime}}),
    #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each [Contact Date] > Loaddate),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows1",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Adviser", "Client Name", "EMAIL"}),
    #"Sorted Rows2" = Table.Sort(#"Removed Other Columns",{{"Case Number", Order.Ascending}}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Sorted Rows2",{{"Contact Date", type date}, {"Contact Time", type time}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type2", "ContactTimeKey", each Text.Replace(Text.From([Contact Time], "en-GB"), ":", "")),
    #"Sorted Rows" = Table.Sort(#"Added Custom",{{"Contact Date", Order.Descending}}),
    #"Lowercased Text" = Table.TransformColumns(#"Sorted Rows",{{"EMAIL", Text.Lower, type text}})
in
    #"Lowercased Text"

 instead of using the query. This made no difference overall

 

However this single table seems to load into the model with the latest data.

 

 so the issue seems to be combining the tables with this query. Mostly this is just combining the tables , editing the emails as some have changed and then looking up their userid by email.  Is this causing a query folding issue?

let
    Source = Table.Combine({#"SLAs Sainsburys", #"SLAs BT", #"SLAs Currys", #"SLAs JLR", #"SLAs Barclays", #"SLAs Stark", #"SLAs Starbucks", #"SLAs NR",  #"SLAs Maximus"}),
    #"Filtered Rows1" = Table.SelectRows(Source, each ([EMAIL] <> null) and ([Contact Type] <> "Inbound Call")),
    #"Merged Queries1" = Table.NestedJoin(#"Filtered Rows1", {"EMAIL"}, Email_Change, {"Old"}, "Email_Change", JoinKind.LeftOuter),
    #"Expanded Email_Change" = Table.ExpandTableColumn(#"Merged Queries1", "Email_Change", {"New"}, {"New Email"}),
    #"Added Custom1" = Table.AddColumn(#"Expanded Email_Change", "Email", each if [New Email]<>null then [New Email] else [EMAIL]),
    #"Removed Other Columns1" = Table.SelectColumns(#"Added Custom1",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Adviser", "Client Name", "ContactTimeKey", "Email"}),
    #"Merged Queries" = Table.NestedJoin(#"Removed Other Columns1", {"Email"}, PhoneUser, {"Username"}, "PhoneUser", JoinKind.LeftOuter),
    #"Expanded PhoneUser" = Table.ExpandTableColumn(#"Merged Queries", "PhoneUser", {"Name", "AdviserId"}, {"Name", "AdviserId"}),
    #"Added Custom" = Table.AddColumn(#"Expanded PhoneUser", "Check", each if Text.Contains([Email],"adviserplus.com") then "Y" else "N"),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Check] = "Y")),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Client Name", "ContactTimeKey", "Name", "AdviserId", "Email"}),
    #"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"Contact Date", Order.Descending}})
in
    #"Sorted Rows"

 

The view query is very simple

 

let
    Source = Sql.Database("PRD-SO-DW2.iia-cloud.com", "master", [Query="

    SELECT *
    FROM [BT_DW_REPORTING].[dbo].[v_Contact_Count_Expanded]
WHERE 'Contact Date' >= '" & DateTime.ToText(Loaddate) & " '
 

	"]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Contact Date", type date}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Adviser", "Client Name", "EMAIL"}),
    #"Sorted Rows2" = Table.Sort(#"Removed Other Columns",{{"Case Number", Order.Ascending}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Sorted Rows2",{{"Contact Time", type time}, {"Contact Date", type datetime}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each [Contact Date] > Loaddate),
    #"Changed Type2" = Table.TransformColumnTypes(#"Filtered Rows",{{"Contact Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type2", "ContactTimeKey", each Text.Replace(Text.From([Contact Time], "en-GB"), ":", "")),
    #"Sorted Rows" = Table.Sort(#"Added Custom",{{"Contact Date", Order.Descending}}),
    #"Lowercased Text" = Table.TransformColumns(#"Sorted Rows",{{"EMAIL", Text.Lower, type text}})
in
    #"Lowercased Text"

 

There are 8 of these then combined

let
    Source = Table.Combine({#"SLAs Sainsburys", #"SLAs BT", #"SLAs Currys", #"SLAs JLR", #"SLAs Barclays", #"SLAs Stark", #"SLAs Starbucks", #"SLAs NR",  #"SLAs Maximus"}),
    #"Filtered Rows1" = Table.SelectRows(Source, each ([EMAIL] <> null) and ([Contact Type] <> "Inbound Call")),
    #"Merged Queries1" = Table.NestedJoin(#"Filtered Rows1", {"EMAIL"}, Email_Change, {"Old"}, "Email_Change", JoinKind.LeftOuter),
    #"Expanded Email_Change" = Table.ExpandTableColumn(#"Merged Queries1", "Email_Change", {"New"}, {"New Email"}),
    #"Added Custom1" = Table.AddColumn(#"Expanded Email_Change", "Email", each if [New Email]<>null then [New Email] else [EMAIL]),
    #"Removed Other Columns1" = Table.SelectColumns(#"Added Custom1",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Adviser", "Client Name", "ContactTimeKey", "Email"}),
    #"Merged Queries" = Table.NestedJoin(#"Removed Other Columns1", {"Email"}, PhoneUser, {"Username"}, "PhoneUser", JoinKind.LeftOuter),
    #"Expanded PhoneUser" = Table.ExpandTableColumn(#"Merged Queries", "PhoneUser", {"Name", "AdviserId"}, {"Name", "AdviserId"}),
    #"Added Custom" = Table.AddColumn(#"Expanded PhoneUser", "Check", each if Text.Contains([Email],"adviserplus.com") then "Y" else "N"),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Check] = "Y")),
    #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Contact Type", "Contact ID", "Contact Date", "Contact Time", "Case Number", "Topic Title", "Workflow Stage", "Workflow Step", "Client Name", "ContactTimeKey", "Name", "AdviserId", "Email"}),
    #"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"Contact Date", Order.Descending}})
in
    #"Sorted Rows"

 

and thats what is loaded. I'm not sure what query folding means?

Hi

 

There are no end date limits in the query or i woudl see the current date

I dont have any incremental refreshes

The SQL view is only created at night

 

The folding is a new one on me.  This was working fine when i was running the full sql within power query. Its only gone odd since the SQL was put inot a view so now I just upload the view.  Is  a view different to a table? 

 

I was loading the data from 1/7/25 to current, but I just changed it to 1/10/25 to current and now loads so could it have been timing out without giving any error? 

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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