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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
PCorbitt
Helper I
Helper I

Quotation Marks in DAX Measure for URL

Hello everyone!

I'm trying to write DAX code to return a measure which includes a SELECTEDVALUE formula to return a URL. Currently this simple formula is just the PBI Service page web address plus the rptfilter - SELECTEDVALUE('Directory'[FullName]). Unfortunately, that doesn't work (apparently because there's a space within the value between first and last name), because if I go to the browser and manually type %27John%20Doe%27 at the end of the URL it DOES! So my question is how surround the FullName with those single quotation marks in my formula? Seems like this should be a simple fix. Thoughts?

1 ACCEPTED SOLUTION

You need to add this part marked in red into your DAX formula:

 

Filtered URL Pass =
var rptfilter = "Directory/FullName eq "&"'"&SELECTEDVALUE('Directory'[FullName])&"'"
return
rpturl&rptfilter

View solution in original post

6 REPLIES 6
poweringthru
Helper I
Helper I

In DAX you append strings using the & operator.


So you can create a new measure like this:

 

 

FullNameInSingleQuotes = "'"&SELECTEDVALUE('Directory'[FullName])&"'"

 

 

Does this solve the need?

Cheers!

Thank you, powerthru. I'm sure this will work! I'm just not sure how to incorporate your solution into my DAX formula. Currently it reads:

 

 

Filtered URL Pass =
var rptfilter = "Directory/FullName eq "&SELECTEDVALUE('Directory'[FullName])
return
rpturl&rptfilter
 
This formula returns the following URL link:
https://app.powerbi.com/groups/me/reports/587ce61e+d2bd-43b6-b5d4-83d9e84676fc1a4fd29OdO4c1299e?expe... _ Directory/FullName eq (followed by the SELECTEDVALUE currently returning as John Doe, but needs to be 'John Doe' to work).
 
Please let me know what I need to change. 
Thanks SO much!

You need to add this part marked in red into your DAX formula:

 

Filtered URL Pass =
var rptfilter = "Directory/FullName eq "&"'"&SELECTEDVALUE('Directory'[FullName])&"'"
return
rpturl&rptfilter

Hello,

late reply but I had to deal with this issue today.

So, for other readers, I have done as follow :

Just replace in your URL the  "  by  %22 

it works,

Regards,

Roland.

It WORKS! Thank you so much for your solution! 

NaveenGandhi
Super User
Super User

Hello @PCorbitt 

Can you post sample data to understand this better?


Regards,

Naveen

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors