• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Filtering PowerPivot with VBA, instead of refreshing all the imported databases.|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / Filtering PowerPivot with VBA, instead of refreshing all the imported databases.|Power Pivot|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower PivotFiltering PowerPivot with VBA, inst…
sp_PrintTopic sp_TopicIcon
Filtering PowerPivot with VBA, instead of refreshing all the imported databases.
Avatar
Nawaf H H AlTaher
Riyadh, Saudi Arabia
Member
Members
Level 0
Forum Posts: 17
Member Since:
June 24, 2020
sp_UserOfflineSmall Offline
1
August 20, 2020 - 2:36 am
sp_Permalink sp_Print

Hello friends Hope all is safe & Well!

I have a PowerPivot that reads from a PowerQuery. The PQ combines many files, so I have more than 30 million rows.

I get requests to display results of 5-10 PatientIDs, from millions of rows. I don't have a problem with that. I do it with DAX, but the problem is it takes a long time to refresh, to apply the Lookupvalue on all the millions of rows. Here is my wish instead.

Can you please help me filter the slicer of PatientID, or Filter the PivotTable (Pic#1), based on the values in sheet DB; range B (Pic#2).

1.pngImage Enlarger

                                                                       2.pngImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage 1.png (39 KB)
  • sp_PlupImage 2.png (7 KB)
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOnlineSmall Online
2
August 20, 2020 - 12:05 pm
sp_Permalink sp_Print

Hi Nawaf,

Welcome to our forum!

When you filter the PivotTable using the Slicer it is not refreshing the query. To do that would take even longer! You should only refresh the query when you expect there is new data to get from the source. Once you have the data loaded into Power Pivot you don't want to be refreshing the query.

If the Slicer is slow to respond it's due to the amount of data in your file and possibly inefficient measures you have in the PivotTable. That said, the measure shown in the screenshot looks like an implicit measure, so it won't be that causing the problem. Of course I'm assuming there aren't other inefficient measures in other PivotTables.

You also need 64-bit Excel to run Power Pivot. I wonder if you only have 32-bit? You can check on the File tab > Account > About Excel.

Mynda

Avatar
Nawaf H H AlTaher
Riyadh, Saudi Arabia
Member
Members
Level 0
Forum Posts: 17
Member Since:
June 24, 2020
sp_UserOfflineSmall Offline
3
August 27, 2020 - 2:18 am
sp_Permalink sp_Print

Thank you very much Mynda, it is my pleasure to be here.

Sorry for not replying any sooner; was trying different methods before replying. Anyway here is my responses to your post.

 

You should only refresh the query when you expect there is new data to get from the source.

Great, is there a way to refresh only the new data instead of refreshing all the past and new?

 

Once you have the data loaded into Power Pivot you don't want to be refreshing the query.

I am forced to refresh, because I am choosing certain account numbers (say 170 accounts out of a million rows). Filtering manually would be a painful exercise. Refreshing would apply the dax to do Lookup function and filter the required data.

 

You also need 64-bit Excel to run Power Pivot.

I have 64, and 16RAM computer. It would be awesome, if there is anyway to speedup the process of refreshing, at least refreshing the latest added data.

Thank you So much! 

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4447
Member Since:
July 16, 2010
sp_UserOnlineSmall Online
4
August 27, 2020 - 9:27 am
sp_Permalink sp_Print

Hi Nawaf,

There's no way to do an incremental refresh in Power Query in Excel. It is available in Power BI though: Power BI Incremental Refresh.

To filter queries based on a list of accounts you need to first create a query containing a list.

Then you can use the List.Contains function in the Fact Table query to filter the rows, e.g.:

= Table.SelectRows(#"Name of your last step", each List.Contains(AccountNumberTable , [AccountNumberColumn]))

It's a bit complex to describe here, but if you get stuck, please come back with a small sample file containing an extract of the fact table data and list of accounts and your query attempt and we'll help you further.

This post has some tips for speeding up queries.

Mynda

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mynda Treacy, s Ramchandran, Kristine Storti, Shanna Henseler
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6212
Posts: 27237

 

Member Stats:
Guest Posters: 49
Members: 31889
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.