How to convert a value into a string with DAX

Hey guys,

I need to concatenate a string and a number into a URL. I tried using the VALUE and FORMAT DAX functions and came up with this:” & [page]

But it prompts an error saying, “We cannot apply operator & to text and number.”
Any idea how I can make this work?

Thanks in advance!

Where do you get these strings from? If they are on the same row but different columns, you can use the concatenate DAX function. Do you have a data sample?

You need to convert the page number into a text and concatenate it with the rest of the expression .
The original expresion = “" is all text.
Convert the number [page] into text with the expression “” & Number.ToText(page)&”
Don’t forget to add &" after the Number.ToText(page) so that it totally computes as per the original
eg with the expression above, for page = x, this is what would happen” & Number.ToText(x)&”
will return “" which is the similar to the original expression.
This could help you figure it out.
Revision 1
PS On second thoughts, I could be mistaken since the topic refers to DAX and my solution applies to MCode.

You could try something like this:” & Format([page] ,"####")

Or you could just use Text.From( [Counter] ).

Let me know if either own of them doesn’t work. Maybe we can think of another solution.