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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
karmptl701
Frequent Visitor

HTML files from database

Hello,

 

I am doing practice in Power BI dektop for my project.
I have an database which is able to store HTML files in it in VARCHAR(MAX) datatype.
When I am retriving it in Power BI, I am not able to get it back in its pure format.
My HTML file only contains 8*10 table on which I want to do visualization and want to create reports.
The HTML files are auto genrated each week.

 

Thank you.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @karmptl701,

 

Based on my assumption, you stored HTML tags with VARCHAR(MAX) datatype in SQL Database, right? If so, when you connect to SQL DB to fetch these HTML tags in Power BI desktop, these values will be considered as text. Currently, Power BI doesn't provide an an interpreter for HTML tags to convert tags to tables. Someone has submitted this feature request, you could click to vote it up:  HTML Tags.

 

As a workaround, instead of saving HTML source into database, you could store HTML tags into a file, then, store file path with binary datatype into database. Loading data into Power BI desktop, you would get a column (named as Column1) listing HTML file path like C:\Users\username\Desktop\filename.txt, then, you could add a custom column in Query Editor mode with below M code:

Custom column=Web.Page(File.Contents([Column1]))

Based on above steps, expand the new custom column, you can get the desired html table.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @karmptl701,

 

Based on my assumption, you stored HTML tags with VARCHAR(MAX) datatype in SQL Database, right? If so, when you connect to SQL DB to fetch these HTML tags in Power BI desktop, these values will be considered as text. Currently, Power BI doesn't provide an an interpreter for HTML tags to convert tags to tables. Someone has submitted this feature request, you could click to vote it up:  HTML Tags.

 

As a workaround, instead of saving HTML source into database, you could store HTML tags into a file, then, store file path with binary datatype into database. Loading data into Power BI desktop, you would get a column (named as Column1) listing HTML file path like C:\Users\username\Desktop\filename.txt, then, you could add a custom column in Query Editor mode with below M code:

Custom column=Web.Page(File.Contents([Column1]))

Based on above steps, expand the new custom column, you can get the desired html table.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It was working before and when I was closing and applying from 'Edit Queries', it asked me about some Privacy level.
I didn't know about that. It stoped working after that.
Then I uninstalled Power BI and reinstalled it.

Now, in Power BI, it is not showing the pathname. It shows the column as binary.

And one more thing, I used VARBINARY(MAX) as datatype. Is it fine ?

 

Thank you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.