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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Power Query from web - importing table with subscript / superscript values

Greetings

 

Data URL: https://docs.microsoft.com/en-us/office365/servicedescriptions/office-online-service-description/off...

 

When importing this data from the web using Power Query, the superscript values are omitted from the data. See the example below, where "Yes" is the data imported successfully, and 1 is the superscript value associated with the data that is cut from the import.

 

Example: Yes1

 

This import must be automated, we cannot rely on copy/paste methods or any manual updates

 

Thanks in advance

 

-CJ

 

1 ACCEPTED SOLUTION
edhans
Super User
Super User

It works fine here, but you may need to enable the new Web Table connector. When I connect to Table1 in the initial connect, the following code is created by Power Query (you can paste this in the Advanced Editor view of a blank query) and it shows the superscripts just fine.

 

 

let
    Source = Web.BrowserContents("https://docs.microsoft.com/en-us/office365/servicedescriptions/office-online-service-description/office-online-service-description"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR > :nth-child(1), MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR > :nth-child(1)"}, {"Column2", "MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR > :nth-child(2), MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR > :nth-child(2)"}, {"Column3", "MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR > :nth-child(3), MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR > :nth-child(3)"}}, [RowSelector="MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR, MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}})
in
    #"Changed Type"

 

 

20200121 11_34_34-Options.png

 

20200121 11_37_31-Untitled - Power Query Editor.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Super User
Super User

It works fine here, but you may need to enable the new Web Table connector. When I connect to Table1 in the initial connect, the following code is created by Power Query (you can paste this in the Advanced Editor view of a blank query) and it shows the superscripts just fine.

 

 

let
    Source = Web.BrowserContents("https://docs.microsoft.com/en-us/office365/servicedescriptions/office-online-service-description/office-online-service-description"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR > :nth-child(1), MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR > :nth-child(1)"}, {"Column2", "MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR > :nth-child(2), MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR > :nth-child(2)"}, {"Column3", "MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR > :nth-child(3), MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR > :nth-child(3)"}}, [RowSelector="MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > TR, MAIN[id='main'] > DIV.table-scroll-wrapper:nth-child(11) > TABLE:nth-child(1) > * > TR"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}})
in
    #"Changed Type"

 

 

20200121 11_34_34-Options.png

 

20200121 11_37_31-Untitled - Power Query Editor.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

This solved the issue - thank you!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors