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
neees78
Helper II
Helper II

hyperlink column to open document from sharePoint library - issues with pdf viewers omitting

Hello, 

I'm connecting my PBI report to read documents from SharePoint Doc_Library

To see properties like size, name and do some QA/QC reporting on library contents 

By using  File.ServerRelativeUrl with http web address - I created a column to open documents directly (like below)

Open doc = "https://yyyyyyyy.sharepoint.com/"&[File.ServerRelativeUrl] ,  changed the category to web URL and all is good after that ! 

I'm able to open all files in that document library 

 

The only problem I have - is when pdf or word ...contains # tag in its name then URL won't open 

it works for all other files/documents 

 

only if the file name contains # then it produces the Hmmm… can't reach this page" error and quote the full URL the file up to # character and omit # character and any string after it! 

 

Any idea why is this? 

 

Best Regards 

 

Anis 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @neees78 ,

In URLs, the hash symbol (#) is often used to indicate a fragment identifier that points to a specific part of a document. When a URL contains a #, the browser may interpret everything after the # as a fragment identifier rather than as part of the file name or path. This is why URLs for files with # in the name do not open correctly. See the documentation: Filter a report using query string parameters in the URL - Power BI | Microsoft Learn.
Therefore, URL encoding of the hash symbols is required, which can be done by replacing the "#" with "%23", i.e. the expression is modified to:

Column =

"https://yyyyyyyy.sharepoint.com/" & SUBSTITUTE([File.ServerRelativeUrl], "#", "%23")

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

8 REPLIES 8
Anonymous
Not applicable

Hi @neees78 ,

In URLs, the hash symbol (#) is often used to indicate a fragment identifier that points to a specific part of a document. When a URL contains a #, the browser may interpret everything after the # as a fragment identifier rather than as part of the file name or path. This is why URLs for files with # in the name do not open correctly. See the documentation: Filter a report using query string parameters in the URL - Power BI | Microsoft Learn.
Therefore, URL encoding of the hash symbols is required, which can be done by replacing the "#" with "%23", i.e. the expression is modified to:

Column =

"https://yyyyyyyy.sharepoint.com/" & SUBSTITUTE([File.ServerRelativeUrl], "#", "%23")

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks Clara ...its now working perfectly ....appreciate your help 🙂

PijushRoy
Super User
Super User

Hi @neees78 

Can you please share two examples of Normal URL and # tag URL







Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





please find below , reports # 6 & 5 open normal, but reports 7&4 no 

all reports reside in the same sharepoint directory .....01_DDR/

neees78_0-1708709132418.png

 

Hi @neees78 

Please use below code (example) to generate new column

 

Column = If(
    CONTAINSSTRING('Table (2)'[FileName],"#"),"https://yyyyyyyy.sharepoint.com/"&LEFT('Table (2)'[FileName],9)&"#"&RIGHT('Table (2)'[FileName],6),
    "https://yyyyyyyy.sharepoint.com/"&'Table (2)'[FileName])

 

 

PijushRoy_0-1708711245295.png

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the ThumbUp 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hi Thanks for your reply - tried it but didn't work 

I capture the full name of the file from "File.ServerRelativeUrl" which contains the full URL from sites/.......including the file name 

I think the issue has to do with the presence of # it breaks URL  ...found similar issue but another application   

https://stackoverflow.com/questions/49627567/go-to-url-not-working-for-url-having-character 

Hi @neees78 

Please create a pbix that contains sample data but still reflects your semantic model (tables, relationships, calculated columns, and measures). Upload the pbix to OneDrive, Google Drive, or dropbox and share the link in this thread. If you are using a spreadsheet to create/import the sample data instead of the manual import method, share the spreadsheet as well. 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Thanks for your help ...PBIX is simple one ...no relationship , one table , I'm afraid even I create it will not help ...as we need a sharepoint  connected library to create URL's with issues ...Clara shared a solution which worked well 

Appreciate your time and help 

Helpful resources

Announcements
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.