• 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

Incorrect Data via Power Query|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Incorrect Data via Power Query|Power Query|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 QueryIncorrect Data via Power Query
sp_PrintTopic sp_TopicIcon
Incorrect Data via Power Query
Avatar
Ryan Kenny
Member
Members
Level 0
Forum Posts: 9
Member Since:
November 2, 2021
sp_UserOfflineSmall Offline
1
November 8, 2021 - 11:33 pm
sp_Permalink sp_Print

Hi all.

I'm having a problem with a Power Query connection between workbooks - Power Query seems to be loading the wrong data and I cannot find the error

In the source workbook there is a column that contains an IF formula which calculates whether the row is overdue or not (based on the difference between TODAY() and another column that holds the target date for that row). The output of the formula is either "Overdue", "Due within 5 days" or "Due in over 5 days".

When I try to load the data from this table into another workbook using Power Query, it loads the wrong value for that column. This doesn't happen for all rows - most are accurate. From what I can tell, it's only happening for rows that have changed value in the last few days. For example, the most recent entry appears in Power Query "Due within 5 days", but in the source workbook it appears as "Overdue". Obviously I thought there must be some problem with the workbook that the query was in, but even when I re-build this query from scratch in a new blank workbook, I get the same incorrect data.

I'm not doing any value-replacement or anything like that, and I can't see where the error could come from. If I just use a basic linked cell (by typing "=" into a cell in the destination workbook, and then selecting the relevant cell in the source workbook) it reads the data across just fine. Any idea why Power Query wouldn't do the same?

Thanks in advance!

Ryan

sp_AnswersTopicSeeAnswer See Answer
Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 627
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
2
November 9, 2021 - 1:29 am
sp_Permalink sp_Print

Probably a stupid question, but, just to check, you are talking about the data being wrong in the actual query results, not just in the preview window when building the query?

Avatar
Ryan Kenny
Member
Members
Level 0
Forum Posts: 9
Member Since:
November 2, 2021
sp_UserOfflineSmall Offline
3
November 10, 2021 - 3:21 am
sp_Permalink sp_Print

Hi Velouria - certainly not a stupid question! It's in both places. I initially noticed it in the query results (the query is loaded to a worksheet), and then traced it back in the query editor. There were some transformations in the query, but I stripped all of those out and the error persisted. Then I re-built it from Source upwards and it still persisted! The I did the same thing in a new blank workbook... and still the error!

The source file is sitting on a shared file server - is it possible that there's some strange caching problem? I find this kind of error the most maddening of all because it makes me worry that the rest of the data load is not reliable. Any help appreciated!

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 627
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
4
November 10, 2021 - 6:32 pm
sp_Permalink sp_Print

I'd probably start by clearing the cache in your Query Options. If that doesn't help, try copying the source file locally and linking to that to see if the problem is still there.

I note you are using the TODAY() function which is volatile when the workbook is open (i.e. recalculates whenever the workbook does) but is not of course when the workbook is closed. I assume the workbook is being opened and saved daily before you try and query it? If not, perhaps you'd be better off calculating the column in the query itself to ensure it's always up to date.

sp_AnswersTopicAnswer
Answers Post
Avatar
Ryan Kenny
Member
Members
Level 0
Forum Posts: 9
Member Since:
November 2, 2021
sp_UserOfflineSmall Offline
5
November 12, 2021 - 12:29 am
sp_Permalink sp_Print

Clearing the cache doesn't do it, but I think you're right about the problem being how the formula calculates. I think what's happening is that Power Query is loading the value of that cell as it stood when the file was last saved, rather than how it displays in the current session.

I was expecting a different behaviour because with a linked cell the values update as soon as you open the source workbook (even if those changes are not saved), but the same thing doesn't seem to happen with Power Query - you have to open the source file, let it calculate, and then save it with the changes before they will appear in the query.

Unfortunately that's not an option for me! I'm just going to recreate the calculation inside Power Query, instead of relying on it to load that calculated column correctly

Thanks for helping me think through it!

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Richard West, Clayton Watson
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 204
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Jefferson Granemann
Glen Coulthard
Nikki Fox
Rachele Dickie
Forum Stats:
Groups: 3
Forums: 24
Topics: 6222
Posts: 27292

 

Member Stats:
Guest Posters: 49
Members: 31913
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.