cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
UncleLewis
Helper V
Helper V

Web Scrape The Column of the Table Wasn't Found

Hi all,

Using Power Query in Power BI.
I scraped a table of Federal Holidays for 2021.
I converted it into a function, created a list of years, and tried to invoke the function.
2022 came down without issue.
However, in 2023 I received the error: "The column 'Federal holiday' of the table wasn't found"

I tried again using 2023 as the base year and converted to a function.
This time I added Text.Trim around the headers but I get the same error.

Here is the url for 2021:
https://www.calendarpedia.com/holidays/federal-holidays-2021.html

Thanks,

-w

1 REPLY 1
ThxAlot
Super User
Super User

Nothing special

let
    fx = (yr as number) =>
        let
            Page = Web.Page(Web.Contents("https://www.calendarpedia.com/holidays/federal-holidays-" & Text.From(yr) & ".html")),
            Navi = Page{0}[Data],
            Tb = Table.RemoveLastN(Table.Skip(Navi)),
            #"Promoted Headers" = Table.PromoteHeaders(Tb)
        in
            #"Promoted Headers",
    
    Invocation = List.Transform({2020..2030}, fx),
    #"Combined Tables" = Table.Combine(Invocation)
in
    #"Combined Tables"

ThxAlot_0-1688946499235.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors