cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
masplin Post Prodigy
Post Prodigy

Simple web query that errors when loaded to data model in Excel

 

This query looks fine in query editor and can be loaded connection only, but if i try to add to the data model  I get "[Expression.error] We cannot convert the value null to type list"

 

I have no idea what this means and makes no sense if it looksok in query window. Can anyone help?

 

Thanks

 

 

let
    Source = Web.Page(Web.Contents("https://tools.morningstar.co.uk/uk/cefreport/default.aspx?SecurityToken=E0GBR01OFV]2]0]FCGBR$$ALL")),
    Data15 = Source{15}[Data],
    Children = Data15{0}[Children],
    Children1 = Children{1}[Children],
    Children2 = Children1{11}[Children],
    Children3 = Children2{1}[Children],
    Children4 = Children3{2}[Children],
    Children5 = Children4{4}[Children],
    Children6 = Children5{1}[Children],
    Children7 = Children6{0}[Children],
    Children8 = Children7{0}[Children],
    Children9 = Children8{1}[Children],
    Children10 = Children9{0}[Children],
    Children11 = Children10{0}[Children],
    Children12 = Children11{0}[Children],
    #"Removed Other Columns" = Table.SelectColumns(Children12,{"Text"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"Text", "Name"}}),
    #"Added Index" = Table.AddIndexColumn(#"Renamed Columns", "Index", 1, 1)
in
    #"Added Index"

 

 

3 REPLIES 3
Super User IV
Super User IV

Re: Simple web query that errors when loaded to data model in Excel

I tested this out, pretty sure it means that you are navigating to a child node that doesn't exist.

---------------------------------------

Not the Power BI thought police...

I have NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

masplin Post Prodigy
Post Prodigy

Re: Simple web query that errors when loaded to data model in Excel

Ah so if i'm using a function to work on a list and every element in the list doesn't have identical strcture (I assumed a website would have) it can run into a blind alley. If say some pages go down onechild route and other go down a differnet route is it possilbe to use try/otherwise but specify a whole bunch of steps for each option?  I've only ever used try/otherwise for single values

 

Thanks

Mike

Microsoft artemus
Microsoft

Re: Simple web query that errors when loaded to data model in Excel

You can propigate nulls like:

 

myTable{2}?[ColumnName]?

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors