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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
M001
Helper I
Helper I

Does Data Model be refreshed together in the backend when we refresh Query?

Hi All,

 

I would like to confirm if data model will be refreshed together along with the refresh of query even we never open Power Pivot UI.

 

I am thinking if I need to add the additional codes in my VBA command to refresh data model in Power Pivot after I refreshed my queries. There are additional calculation columns in my data models that I definitely need to make sure they are well refreshed

 

Hope someone could enlighten me, thank you

 

Sub RefreshAll()

'Disable background refresh

Dim lCnt As Long

With ActiveWorkbook
    For lCnt = 1 To .Connections.Count

        If .Connections(lCnt).Type = xlConnectionTypeOLEDB Then
            .Connections(lCnt).OLEDBConnection.BackgroundQuery = False
        End If
        
    Next lCnt

End With


'Start refreshing all
Dim i As Integer


'Section for Queries
Dim queryNames(1 To 3) As String
Dim queryName As Variant

queryNames(1) = "Query - Dummy_1"
queryNames(2) = "Query - Dummy_2"
queryNames(3) = "Query - Dummy_3"


For Each queryName In queryNames

ThisWorkbook.Connections(queryName).Refresh
DoEvents

Next queryName


'Section for Data Models (I am not sure if I need to add this section)
Dim datamodelNames(1 To 3) As String
Dim datamodelName As Variant

datamodelNames(1) = "Dummy_1"
datamodelNames(2) = "Dummy_2"
datamodelNames(3) = "Dummy_3"


For Each datamodelName In datamodelNames

ThisWorkbook.Model.ModelTables(datamodelName).Refresh
DoEvents

Next datamodelName


End Sub

 

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Not exactly sure what you are asking, but it is possible to refresh individual queries (tables)  in a dataset, and even individual partitions in case your table has more than one.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors