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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
bwhitlocksaxco
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
Phil_Seamark
Microsoft Employee
Microsoft Employee

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!

View solution in original post

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!

View solution in original post

3 REPLIES 3
Phil_Seamark
Microsoft Employee
Microsoft Employee

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!

Doesnt this create an integer? I want the number col as 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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