cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bwhitlocksaxco Frequent Visitor
Frequent Visitor

Formula for Number to Text

Trying to create a new column that is a concatenation of a number(a.value) and text(UOM). Im pulling from a sql db on this. A problem Im having is my number is stored as a number. I tried to use convert(varchar,a.value) but the output is 12.000000000, I need to slice out the zero's to make this 12 as text so I can merge with my UOM to get 12 oz. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Phil_Seamark Super Contributor
Super Contributor

Re: Formula for Number to Text

Hi @bwhitlocksaxco

 

Try wrapping an INT around the a.value

 

New Column = INT( table[number col] ) & " - " & table[UOM]

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Highlighted
Phil_Seamark Super Contributor
Super Contributor

Re: Formula for Number to Text

Hi @bwhitlocksaxco

 

It does create an integer, but that is just to strip the decimals.  The & operator then implicitly converts the integer to text by concatenating it to a text value.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

3 REPLIES 3
Phil_Seamark Super Contributor
Super Contributor

Re: Formula for Number to Text

Hi @bwhitlocksaxco

 

Try wrapping an INT around the a.value

 

New Column = INT( table[number col] ) & " - " & table[UOM]

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

bwhitlocksaxco Frequent Visitor
Frequent Visitor

Re: Formula for Number to Text

Doesnt this create an integer? I want the number col as text

Highlighted
Phil_Seamark Super Contributor
Super Contributor

Re: Formula for Number to Text

Hi @bwhitlocksaxco

 

It does create an integer, but that is just to strip the decimals.  The & operator then implicitly converts the integer to text by concatenating it to a text value.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 302 members 3,168 guests
Please welcome our newest community members: