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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Checking file existance in Sharepoint with URL based on DAX?

Can anyone help me with the following?

I'm building a report for an exported sales archive to consult old (Excel) data and lots of associated PDF files.
The PDF files were automatically created and are stored in a SharePoint library. The URL is not part of the Excel data.
There is however a consistance in the name convention of the PDF files, which contains order and invoice number.
With that, I created a new column which generates the necessary URL's based on this data, which looks like this:

URL invoice = "https://tenant.sharepoint.com/sites/archive/documents/pdf/"&data[Year]&"/"&data[Ordernumber]&"-invoice-"&data[Invoicenumber]&".pdf"


I switched data category to 'Web URL' and I created a matrix which contains ordernumer and assosiated URL's with an URL icon (see image below).

2022-06-15_13-59-27.jpg





So far so good. Now comes the challenge.
Power BI creates a URL for every instance, whether a file exists or not. For example, not every order has a credit note.
Is there a possibility to show the URL icon, ONLY if the specific file EXISTS in the SharePoint library?

Any help would be appreciated.





1 ACCEPTED SOLUTION
Anonymous
Not applicable

I created a workaround which gives me the required result. I created an extra column, which checks if an invoice number exists in the data:

Invoice_available = if(data[invoice]<>"","Yes","No")

Next I added an if-statement on the URL measure:

URL invoice = IF(data[Invoice_available]="Yes",
"https://tenant.sharepoint.com/sites/archive/documents/pdf/"&data[Year]&"/"&data[Ordernumber]&"-invoice-"&data[Invoicenumber]&".pdf"",
"")

This shows a URL icon if a match is found, otherwise it remains empty

2022-06-21_10-19-51.jpg

Not 100%, but it gives the required result. 🙂

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I created a workaround which gives me the required result. I created an extra column, which checks if an invoice number exists in the data:

Invoice_available = if(data[invoice]<>"","Yes","No")

Next I added an if-statement on the URL measure:

URL invoice = IF(data[Invoice_available]="Yes",
"https://tenant.sharepoint.com/sites/archive/documents/pdf/"&data[Year]&"/"&data[Ordernumber]&"-invoice-"&data[Invoicenumber]&".pdf"",
"")

This shows a URL icon if a match is found, otherwise it remains empty

2022-06-21_10-19-51.jpg

Not 100%, but it gives the required result. 🙂
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Based on my test, it's not supported to display image in Matrix visual value part. As matrix value will be aggregated and return just "values" rather than image.

 

Best Regards

Lucien

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.