Forum Discussion
Using DAX to create custom URL
Hello! I'm using DAX measures to create custom URLs based on the visual the end-user is seeing. I'm using a value from a static table as part of the measure - ('YEAR'[YEAR]), see below.
The problem I'm having is that sometimes the custom URL works. sometimes it doesn't. Example:
- "http://www.oabis.state.pa.us/SGWS/"& SELECTEDVALUE('YEAR'[YEAR]) &"/"& SELECTEDVALUE('YEAR'[YEAR]) &"_SGWS_Dashboard_Charts.pdf#page=4" works, where ('YEAR'[YEAR]) = 2021
but
- "http://www.oabis.state.pa.us/SGWS/"& SELECTEDVALUE('YEAR'[YEAR]) &"/"& SELECTEDVALUE('YEAR'[YEAR]) &"_SGWS_Dashboard_Charts.pdf#page=5" doesn't work.
I'm at wit's end trying to figure this out. I can hard code SELECTEDVALUE('YEAR'[YEAR]) to 2021, but that means next year when this report comes out, I have to do the same things to the other URLs.
Am wondering if anyone else came across this issue and has a solution. Thanks!
2 Replies
- amitchandakSuper User
Anonymous , Based on what I got.
You can use selectedvalue only in a measure. Are creating a measure or column? Try as a measure.
- AnonymousNot applicable
amitchandak , sorry, should have specified. It is a measure I'm using.