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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Concatenate two numbers with decimal

I have two whole number columns that I would like to concatenate into 1 decimal column. For example, column A contains the value 2 (as in 2 months ago), and column B contains 1 (as in "the first week" of the month). I want the resulting calculated column to show 2.1 (2 months ago, first week of that month), formatted as a decimal. I tried the following:

 
FORMAT( Forecast[col1] & "."
& Forecast[col2], "##.#")
 
FORMAT( Forecast[col1] & "."
& Forecast[col2], DOUBLE)
 
However, when the column finishes calculating, it is still in text format, and when I try to change the data type, it says it cannot. I need to to sort as a number which is why I am trying to convert it.
2 REPLIES 2
Sumanth_23
Memorable Member
Memorable Member

hi @Anonymous, you can concatenate the 2 columns and then format the same as a whole number - please refer to the below screenshots 

Month-Day = 'Z-DateTime-Sort'[Month2] & 'Z-DateTime-Sort'[Day2]
You can hit proceed on the warning that pops up when you change from Text to Whole number

Sumanth_23_1-1600883662894.png

 

Sumanth_23_2-1600883685698.png

 

Please mark the post as a solution and provide a 👍 if my comment helped with solving your issue. Thanks!

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!

Proud to be a Super User!



Anonymous
Not applicable

It looks like what was happening is that I had another measure referencing this column as text with " " so it wasn't able to convert. I removed the references to this column and the conversion worked.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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