Forum Discussion
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:
How should I write them to appear correctly?
Thank you in advance.
- Anonymous4 years ago
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!
4 Replies
- Seanan
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:
Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.- AnonymousNot 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() )- Seanan
Solution Supplier
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:
Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.