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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to write quotation marks as text string in DAX?

Hello,

 

I need to write an URL in DAX that includes quotation marks "" but I'm not able to write them correctly as string.

I want to write this:

filter="documentId=123"
 
I tried this way and I get an error:
"filter="documentId=123""
And I also tried using two quotation marks but in the web browser I get two " too:
"filter=""documentId=123"""

 

How should I write them to appear correctly?

Thank you in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello,

The problem with that is when you open the link it appears with double " in the browser.

Anyway, I was able to solve the proble using %22 which is the code for quotation marks in html.

 

Thank you for your help. Kind regards!

View solution in original post

4 REPLIES 4
Seanan
Solution Supplier
Solution Supplier

Hi @Anonymous 

Is it just 1 URL? You can try something like the following code (Used in a calculated column):

StringQuotes = VAR LeftText = CONCATENATE(LEFT('Table (2)'[Column1],7),"""") VAR RightText = CONCATENATE(RIGHT('Table (2)'[Column1],14),"""") return CONCATENATE(LeftText,RightText)

Output:

NVIDIA_Share_d4I7ccpIgO.png

 

 

 

 

 

 

Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.

Anonymous
Not applicable

Hello Seanan,

 

Than you for your answer. Unfortunately, I need to use a measure instead of a calculated column, as I'm using the USERPRINCIPALNAME() function.

This is my current code

URL = IF(
   HASONEVALUE(Table[Column1]), 
    "https://xxxxxx&user=" & USERPRINCIPALNAME() & "xxxxxx&filter=""documentId=" & VALUES(Table[Column1]) & """", 
   BLANK()
   )

Hi @Anonymous 

Would it be viable to add the quotation marks into your already existing measure? If so you can add extra quotation marks in your measure like this:

String = IF(HASONEVALUE('Table (2)'[Column1]),"""Testing""")

Result:

NVIDIA_Share_sw61A3fiYC.png

 

 

 

 

 

Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.

Anonymous
Not applicable

Hello,

The problem with that is when you open the link it appears with double " in the browser.

Anyway, I was able to solve the proble using %22 which is the code for quotation marks in html.

 

Thank you for your help. Kind regards!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.