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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Ttaylor9870
Helper III
Helper III

England Counties JSON

Hi All,

 

I am looking for a JSON file containing all england counties does anyone know of a wesbite that would contain this?

 

Many Thanks,

 

Taylor

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @Ttaylor9870 ,

 

I did a bit of googling and I am surprised that, indeed, there might be nothing out there. Perhaps that's a chance for a small business 😄 ...

 

Anyway, not sure whether you like this suggestion, but maybe wikipedia can help as a workaround?
The result:

tackytechtom_1-1678845355660.png

 

 

And here how I did it:

Click on Get Data, use the WEB connector and paste the following URL into the URL bar:

https://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom

tackytechtom_2-1678845441487.png

Next, select table2:

 

tackytechtom_0-1678845288719.png

 

Lastly, do some cleansing:

tackytechtom_3-1678845500705.png

 

 

Here the full code in M that you should be able to copy as is:

let
    Source = Web.BrowserContents("https://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7)"}, {"Column2", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6)"}, {"Column3", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5)"}, {"Column4", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4) + TH:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(3), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5)"}, {"Column5", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4)"}, {"Column6", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3) + TH[colspan=""2""]:not([rowspan]):nth-child(5):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4) + TH:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(3) + TH:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(3)"}, {"Column7", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3) + TH[colspan=""2""]:not([rowspan]):nth-child(5):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4) + TH:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(3) + TH:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(2) + TH:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(1), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(2)"}, {"Column8", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3) + TH[colspan=""2""]:not([rowspan]):nth-child(5):nth-last-child(2) + TH[rowspan=""2""]:not([colspan]):nth-child(6):nth-last-child(1), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(1), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(1)"}}, [RowSelector="TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"County", type text}, {"Currentceremonial[2]", type text}, {"From 1974[3]", type text}, {"From 1974[3]_1", type text}, {"Postal1974–1996[4]", type text}, {"1889–1974", type text}, {"1889–1974_2", type text}, {"Before 1889", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each [County] <> null and [County] <> ""),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Currentceremonial[2]", "From 1974[3]", "From 1974[3]_1", "Postal1974–1996[4]", "1889–1974", "1889–1974_2", "Before 1889"})
in
    #"Removed Columns"

 

You are of course right, you should be using i.e. an API service, instead of letting Power BI read the HTML of wikipedia. This is quite a vulnerable one and I wouldn't use it in an enterprise project. But for small ones, it might do the job. 

 

Since I suppose you are having that data already somewhere on your transactional fact table, I wonder whether your source system couldn't provide the dimension table as well?

 

Let me know, if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @Ttaylor9870 ,

 

I did a bit of googling and I am surprised that, indeed, there might be nothing out there. Perhaps that's a chance for a small business 😄 ...

 

Anyway, not sure whether you like this suggestion, but maybe wikipedia can help as a workaround?
The result:

tackytechtom_1-1678845355660.png

 

 

And here how I did it:

Click on Get Data, use the WEB connector and paste the following URL into the URL bar:

https://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom

tackytechtom_2-1678845441487.png

Next, select table2:

 

tackytechtom_0-1678845288719.png

 

Lastly, do some cleansing:

tackytechtom_3-1678845500705.png

 

 

Here the full code in M that you should be able to copy as is:

let
    Source = Web.BrowserContents("https://en.wikipedia.org/wiki/List_of_counties_of_the_United_Kingdom"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7)"}, {"Column2", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6)"}, {"Column3", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5)"}, {"Column4", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4) + TH:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(3), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5)"}, {"Column5", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4)"}, {"Column6", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3) + TH[colspan=""2""]:not([rowspan]):nth-child(5):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4) + TH:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(3) + TH:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(3)"}, {"Column7", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3) + TH[colspan=""2""]:not([rowspan]):nth-child(5):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(4) + TH:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(3) + TH:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(2) + TH:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(1), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(2), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(2)"}, {"Column8", "TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TH[rowspan=""2""]:not([colspan]):nth-child(1):nth-last-child(6) + TH[rowspan=""2""]:not([colspan]):nth-child(2):nth-last-child(5) + TH[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[rowspan=""2""]:not([colspan]):nth-child(4):nth-last-child(3) + TH[colspan=""2""]:not([rowspan]):nth-child(5):nth-last-child(2) + TH[rowspan=""2""]:not([colspan]):nth-child(6):nth-last-child(1), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(8) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(3):nth-last-child(6) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(8):nth-last-child(1), TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR > TD:not([colspan]):not([rowspan]):nth-child(1):nth-last-child(7) + TD:not([colspan]):not([rowspan]):nth-child(2):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(3):nth-last-child(5) + TD:not([colspan]):not([rowspan]):nth-child(4):nth-last-child(4) + TD:not([colspan]):not([rowspan]):nth-child(5):nth-last-child(3) + TD:not([colspan]):not([rowspan]):nth-child(6):nth-last-child(2) + TD:not([colspan]):not([rowspan]):nth-child(7):nth-last-child(1)"}}, [RowSelector="TABLE.wikitable.sortable.jquery-tablesorter:nth-child(12) > * > TR"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"County", type text}, {"Currentceremonial[2]", type text}, {"From 1974[3]", type text}, {"From 1974[3]_1", type text}, {"Postal1974–1996[4]", type text}, {"1889–1974", type text}, {"1889–1974_2", type text}, {"Before 1889", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each [County] <> null and [County] <> ""),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Currentceremonial[2]", "From 1974[3]", "From 1974[3]_1", "Postal1974–1996[4]", "1889–1974", "1889–1974_2", "Before 1889"})
in
    #"Removed Columns"

 

You are of course right, you should be using i.e. an API service, instead of letting Power BI read the HTML of wikipedia. This is quite a vulnerable one and I wouldn't use it in an enterprise project. But for small ones, it might do the job. 

 

Since I suppose you are having that data already somewhere on your transactional fact table, I wonder whether your source system couldn't provide the dimension table as well?

 

Let me know, if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

This one works great for one level down LA LA JSON 

 

This guy did a load of useful ones, but dont think counties https://github.com/martinjc/UK-GeoJSON/tree/master 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.