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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Convert a column with numbers and text values to decimal values

Hi

I have an issue with converting the data type of a column. The column contains numeric values (decimals) and one text value (NA). I want to keep the NA's as that accurately represents the nature of the data. However, when I try to convert this column to fixed decimal, it returns an error for all text values. 

Is there a way that I can keep NA's and convert numeric values into fixed decimal type? 

Thanks!

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Just as what @az38 mentioned, it is not supported in Power BI.

One workaround, create a measure like so:

Measure = 
VAR Data_ = SUM('Table'[Column1 - Copy])
RETURN 
IF(ISBLANK(Data_),"N/A",Data_)

NA.JPG

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Just as what @az38 mentioned, it is not supported in Power BI.

One workaround, create a measure like so:

Measure = 
VAR Data_ = SUM('Table'[Column1 - Copy])
RETURN 
IF(ISBLANK(Data_),"N/A",Data_)

NA.JPG

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

az38
Community Champion
Community Champion

@Anonymous  no, there is no such way to get text value as any number


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
amitchandak
Super User
Super User

@Anonymous , one idea is to  extract number from it and mark the new column as decimal column. You have to add code to get decimal too

https://eriksvensen.wordpress.com/2018/03/06/extraction-of-number-or-text-from-a-column-with-both-text-and-number-powerquery-powerbi/

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.