Reply
Regular Visitor
Posts: 22
Registered: ‎05-11-2016
Accepted Solution

DAX function for converting a number into a string?

I have a string (url) and a number (pagination), I need to concatenate them into a resulting URL. 

 

I have search and looked at the VALUE and FORMAT dax functions but can't make it work in converting a number into a string. e.g.

 

"http://www.xyz.com?page=" & [page] 

returns an error  "We cannot apply operator & to text and number. 

 

Any clues how I can convert [page] to a string?

 


Accepted Solutions
Regular Visitor
Posts: 22
Registered: ‎05-11-2016

Re: DAX function for converting a number into a string?

Thanks, ended up using Text.From( [Counter] )

View solution in original post


All Replies
New Contributor
Posts: 585
Registered: ‎02-17-2016

Re: DAX function for converting a number into a string?

@cousinlarry

 

try using 

"http://www.xyz.com?page=" & Format([page] ,"####")

 

If this works please accept as a solution and also give Kudos. If it does not work let me know what happened.

 

Cheers

 

 

 

Regular Visitor
Posts: 22
Registered: ‎05-11-2016

Re: DAX function for converting a number into a string?

Thanks, ended up using Text.From( [Counter] )

Super Contributor
Posts: 4,720
Registered: ‎07-08-2016

Re: DAX function for converting a number into a string?

@cousinlarry

 

You can also do the concatenation by “Merge Columns” in Query Editor. Select these two columns and click “Merge Columns”.

DAX function for converting a number into a string_1.jpg

 

Best Regards,

Herbert

Visitor
Posts: 5
Registered: ‎11-03-2016

Re: DAX function for converting a number into a string?

= "Text" & Number.ToText(Number)

Frequent Visitor
Posts: 3
Registered: ‎01-24-2018

Re: DAX function for converting a number into a string?

Format() is the correct answer. What you've used is not DAX

Highlighted
Member
Posts: 70
Registered: ‎10-31-2018

Re: DAX function for converting a number into a string?

HOw to you use this FORMAT() function in example?

lets say if you have two columns where you are appling into  a meaure 

ie 

newmeasure = viewname[columnnameingar] and  viewname[newcolumnstring] , "a stringvalue"