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
PunchBird
Helper V
Helper V

Button with URL link that only can be opened as from specific date

Hi,

I would like to create buttons with URL links that only can be opened as from a specific date. So for example the link in button 1 only works as from 1 December, button 2 as from 2 December etc. If these buttons are clicked on 30 November, nothing happens (or better: a pop-up appears that you can't click it yet). Is this possible in Power BI? 

Thanks!

1 ACCEPTED SOLUTION
PunchBird
Helper V
Helper V

Hi all, I managed to solve it myself. In case anyone needs this in the future, here are the steps:

  • First, add a table with the URLs and what dates you want to allow them to be opened. In 'Column tools', change the data category of the column with URLs to 'Web URL'
  • Then create a DAX measure:
Open URL =
VAR _PickDate = CALCULATE(MAX('Table'[Date]),'Table'[Index]=1)
VAR _Date = FORMAT(_PickDate,"yymmdd")
VAR _Today = FORMAT(TODAY(),"yymmdd")
VAR _Link = CALCULATE(MAX('Table'[URL]),'Table'[Index]=1)
RETURN
IF(_Today >= _Date, _Link)
  • Next, in the report, insert a button, turn on Action, change Type to 'Web URL' and under 'Web URL' click on the function-button (fx) and select the measure you just created
  • In the Tooltips I added a message for the user explaining why the URL can't be opened (if relevant)

View solution in original post

8 REPLIES 8
PunchBird
Helper V
Helper V

Hi all, I managed to solve it myself. In case anyone needs this in the future, here are the steps:

  • First, add a table with the URLs and what dates you want to allow them to be opened. In 'Column tools', change the data category of the column with URLs to 'Web URL'
  • Then create a DAX measure:
Open URL =
VAR _PickDate = CALCULATE(MAX('Table'[Date]),'Table'[Index]=1)
VAR _Date = FORMAT(_PickDate,"yymmdd")
VAR _Today = FORMAT(TODAY(),"yymmdd")
VAR _Link = CALCULATE(MAX('Table'[URL]),'Table'[Index]=1)
RETURN
IF(_Today >= _Date, _Link)
  • Next, in the report, insert a button, turn on Action, change Type to 'Web URL' and under 'Web URL' click on the function-button (fx) and select the measure you just created
  • In the Tooltips I added a message for the user explaining why the URL can't be opened (if relevant)
PunchBird
Helper V
Helper V

 @amitchandak Many thanks! The URL's that are used in the report are fixed though, so what would the measure look like if viewers should only be able to open URL https://community.powerbi.com/ after 1/12/2022 ? Is this possible?

hi @PunchBird ,

It is possible by using creating a dynamic measure, 

 

Dynamicmeasure = "URL>date="& format(selectedvalue(Date[date]), "yyyy-mm-dd")

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

@amitchandak @NikhilChenna I am trying to implement your measure but it doesn't work. I probably don't create it correctly. Could you please give an example using 1/12/2022 as date and  https://community.powerbi.com/  as URL ? My apologies for not understanding!

Hi @PunchBird ,

 

DynamicMeasure = 
"https://community.powerbi.com/ "&format("1/12/2022"), "yyyy-mm-dd")

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

@NikhilChenna thanks for this but it doesn't work... the syntax isn't even correct

Hi @PunchBird ,

 

Please refer this link,

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-hyperlinks-in-tables?tabs=powerbi...

 

https://www.youtube.com/watch?v=m4a2c55eXMU

 

This will help you out.

 

Regards,

Nikhil Chenna

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

amitchandak
Super User
Super User

@PunchBird , You need create dynamic url in that case like

 

measure = "URL>date="& format(selectedvalue(Date[date]), "yyyy-mm-dd")

and use that

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.