PivotTable in Excel

Samir abdelmalek 21 Reputation points
2021-05-03T21:26:19.957+00:00

Hi All,

I'm using a tabular model in Excel, everytime i add a filter, row or column in the PivotTable, the excel tries to execute the query to refresh data. Since our tabular model is full of data and dax, it takes time every time the excel refresh data.

Is there some way to disactivate this on Excel ? and after the creation of my PivotTable i can click on "Refresh" or somewhere in Excel to execute the whole query when we want ?

If it is possible, i will be grateful if you share it with me.

Thanks.

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,237 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,618 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Emily Hua-MSFT 27,466 Reputation points
    2021-05-04T08:59:39.413+00:00

    @Samir abdelmalek

    Everytime you add or remove a row or column in the PivotTable via a field, you may tick the box of "Defer Layout Update" below the Pivot Table fields first.

    93582-capture10.png

    When you’re finished changing the fields, you can click on the “Update” button which is towards the right of the Defer Layout Update box, then the Pivot Table would be updated or recalculated. You can remove the checkmark from the Defer Layout Tab as well.

    More information, please refer to "PivotTables VIII: “Defer Layout Update”, or adding multiple fields in one fell swoop".

    If needed, you could also go to PivotTable Analyze > Options > Data to uncheck “Refresh data when opening the file”.

    Hope the information could be helpful.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Ken Burns 0 Reputation points
    2023-02-04T01:03:24.8+00:00

    You can deactivate auto-refresh in Excel pivot tables. Here's how:

    1. Right-click on the pivot table and select "PivotTable Options".
    2. In the "PivotTable Options" dialog box, go to the "Data" tab.
    3. Uncheck the "Refresh data when opening the file" checkbox.
    4. Click "OK" to close the dialog box.

    This will deactivate the auto-refresh feature for that pivot table.

    You can also turn off auto-refresh for specific pivot tables or all pivot tables in a workbook using VBA macros. Here's an example of a VBA macro that will turn off auto-refresh for all pivot tables in the active workbook:

    Sub TurnOffAutoRefresh()
    
    Dim ws As Worksheet
    Dim pt As PivotTable
    
    For Each ws In ThisWorkbook.Worksheets
        For Each pt In ws.PivotTables
            pt.ManualUpdate = True
        Next pt
    Next ws
    
    End Sub
    
    

    To use this macro, follow these steps:

    1. Open the workbook containing the pivot tables.
    2. Press "Alt + F11" to open the VBA editor.
    3. Insert a new module by right-clicking on "Modules" in the "Project Explorer" on the left side of the screen and selecting "Insert" > "Module".
    4. Copy and paste the macro into the new module.
    5. Close the VBA editor and return to the workbook.
    6. Press "Alt + F8" to open the "Macros" dialog box.
    7. Select the "TurnOffAutoRefresh" macro and click "Run".

    This will turn off auto-refresh for all pivot tables in the workbook. To turn off auto-refresh for specific pivot tables, you can modify the macro to loop through only the pivot tables that you want to change.

    0 comments No comments