Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Boricuanet
Frequent Visitor

Validate data when importing file

Hello dear community,

 

I have the following problem and also query.

How can I validate the data before extracting the data, check the file(source) contains information. To avoid errors(attached image).
For example: validate if report.html has data. If NO data, create a table with two columns, one row with zero values.

(I know that the error is due to not finding the "Computer" column and it will never exist when there is no data in the html file).

Boricuanet_0-1654893893967.png

 

 

 

let
    Origen = Web.Contents("https://site.com/report.html"),
    #"Tabla extraída a partir de HTML" = Html.Table(Origen, {{"Column1", "TABLE:nth-child(91) > * > TR > :nth-child(1)"}, {"Column2", "TABLE:nth-child(91) > * > TR > :nth-child(2)"}, {"Column3", "TABLE:nth-child(91) > * > TR > :nth-child(3)"}, {"Column4", "TABLE:nth-child(91) > * > TR > :nth-child(4)"}}, [RowSelector="TABLE:nth-child(91) > * > TR"]),
    #"Encabezados promovidos" = Table.PromoteHeaders(#"Tabla extraída a partir de HTML", [PromoteAllScalars=true]),
    #"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"Computer", type text}, {"Number", Int64.Type}, {"%", Int64.Type}, {"", type text}}),
    #"Columnas quitadas" = Table.RemoveColumns(#"Tipo cambiado",{""}),
    #"Tipo cambiado1" = Table.TransformColumnTypes(#"Columnas quitadas",{{"Number", Int64.Type}})
in
    #"Tipo cambiado1"

 

 

 

 

 

 


Appreciated Any guidance

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

MissingField.Ignore might be able to help with that.  It will bypass the error instead of stopping on it.  Here is a video showcasing the feature.

https://www.youtube.com/watch?v=D59nkSr_JqQ&ab_channel=Goodly

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

MissingField.Ignore might be able to help with that.  It will bypass the error instead of stopping on it.  Here is a video showcasing the feature.

https://www.youtube.com/watch?v=D59nkSr_JqQ&ab_channel=Goodly

 

Hi jdbuchanan71

Thanks for the link. It will help me to orient myself.

Best regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.