• 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
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Expression.Error; Cannot convert the value null to type Logical.0:|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Expression.Error; Cannot convert the value null to type Logical.0:|Power Query|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
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 QueryExpression.Error; Cannot convert th…
sp_PrintTopic sp_TopicIcon
Expression.Error; Cannot convert the value null to type Logical.0:
Avatar
ExcelNovice2020
Member
Members
Level 0
Forum Posts: 62
Member Since:
February 8, 2020
sp_UserOfflineSmall Offline
1
May 17, 2022 - 6:06 am
sp_Permalink sp_Print

Is anyone familiar with what might be causing the following:

"We couldn't get data from an external data source.  Please try again later.  If the problem persists, please contact the administrator for the external data source.  Here is the error message that was returned from the Analysis Server named [Expression.Error] We cannot convert the value null to type Logical.0:

I ONLY receive this error on occasion and it only comes up with a refresh outside PQ.  Every single time I am in PQ, I never receive any type of error.

I can post the file if needed but looking for advice on what may cause this or ways within PQ to avoid this.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1844
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
May 19, 2022 - 10:48 pm
sp_Permalink sp_Print

Hard to say without a file.

The answer is in your data, there is an operation performed in a column where nulls should be converted to logical before any operation.

Avatar
ExcelNovice2020
Member
Members
Level 0
Forum Posts: 62
Member Since:
February 8, 2020
sp_UserOfflineSmall Offline
3
May 21, 2022 - 1:29 am
sp_Permalink sp_Print

I know.  Agree with your assessment; I just cannot find it.  And, it's not constant but upon auto refresh, I get the error, along with an occasional different expression.error.  This only occurs when I am pulling data from a site (source) that is continuously updating.  

I have attached the file for reference.  There are seven queries where I am attempting an auto refresh every minute.  These seven queries are pulling data from a site that updates data/stats based upon the current Major League baseball games going on (if not at the time, there typically is no issues) and brings the new data in the the "live" updates.  The seven queries are as follows:

"LiveH2HScoresCondensed"

"LiveScores"

"LiveH2HPoints"

"LiveStandings"

"LiveRotoScore"

"LiveTotalPointsScore"

"LiveOPRScore"

I am not saying there are issues with each query.  However, when these are checked for the one minute auto-refresh, I tend to receive the expression.error.  My other queries work fine.  I figured it was something with the source and the continuous updates; I was missing something there. 

Avatar
ExcelNovice2020
Member
Members
Level 0
Forum Posts: 62
Member Since:
February 8, 2020
sp_UserOfflineSmall Offline
4
May 27, 2022 - 1:58 am
sp_Permalink sp_Print

Before moving on, I thought I would see if there is anything else I can add to this to help me with my Expression.Error issues.  It is difficult to pinpoint as they do not occur often.  But, if I have the queries mentioned above set for an automatic update each minute, they will eventually occur.  

My main goal was to share this file with others so they can view the updated standings/scores as they occur in real-time.  With the Expression.Error issues, I am afraid to expose this to other users for viewing.  Thanks.   

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 688
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
5
May 27, 2022 - 5:46 pm
sp_Permalink sp_Print

There are quite a few places it could occur. For example, you have a lot of comparisons like if [Total] > 1 then which would cause that error if the Total field is null. A simple way around that is to use the coalesce operator if it is available to you, or just use an explicit comparison to true:

if [Total] > 1 = true then

since null = true will return false.

Avatar
ExcelNovice2020
Member
Members
Level 0
Forum Posts: 62
Member Since:
February 8, 2020
sp_UserOfflineSmall Offline
6
May 27, 2022 - 11:02 pm
sp_Permalink sp_Print

At first, I had the code different with some "null catches" and thought I had fixed what you were referencing above.  Apparently not.

I am really interested in trying the coalesce operator.  Is there anyway you could pick just one comparison, say from the "LiveH2HScoresCondensed" query and show me an example how this might work (if available on my end) using the coalesce operator?  I could then see what you mean and apply to all the rest.  Thanks.  

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Susan VanRiper, Jig Dhimmar, Lorna Henning, Joaquim Amorim, Nikita Bhatia
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
jaryszek: 183
Newest Members:
David von Kleek
Ronald White
Ginette Guevremont
Taryn Ambrosi
Mark Davenport
Christy Nichols
Harald Endres
Ashley Hughes
Herbie Key
Trevor Pindling
Forum Stats:
Groups: 3
Forums: 24
Topics: 6528
Posts: 28594

 

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

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • 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

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

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

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.