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
charleshale
Responsive Resident
Responsive Resident

M - "DataFormat.Error: We couldn't convert to Number. Details: undefined"

I have a plain vanilla table of 2 text columns that I am trying to group (group 2nd column by first, show all rows.

 

I am getting the dreaded "DataFormat.Error: We couldn't convert to Number. Details: undefined".   In accordance with the posts on this forum about the issue, I've cleaned the text, trimmed it, converted back and forth between numbers and text, removed errors, and, in short, I've tried every cleanse I can think of but still must have some bad data somewhere that is causing the error and that PowerBI can't remove.   Any suggestions?   WWID  (What would @ImkeF do 🙂 ?  )

 

charleshale_0-1634266961603.png

 

Thank you

 

Charlie

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Ha, ha @charleshale  😉

I would add a column that tells me if there is more than just numbers in that column like so:

Text.Length(Text.Remove([PID], {"0".."9"})) > 0

Then filter on this new column for "true".
... Re-reading your request:
Are you saying that while you're trying convert to TEXT, you're getting an error complaining that the conversion to NUMBER has failed?
This would be an indication that a conversion in a previous step is causing it.
So you might want to implement that step before that number-conversion step that migh sit somewhere in previous steps.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

2 REPLIES 2
ImkeF
Super User
Super User

Ha, ha @charleshale  😉

I would add a column that tells me if there is more than just numbers in that column like so:

Text.Length(Text.Remove([PID], {"0".."9"})) > 0

Then filter on this new column for "true".
... Re-reading your request:
Are you saying that while you're trying convert to TEXT, you're getting an error complaining that the conversion to NUMBER has failed?
This would be an indication that a conversion in a previous step is causing it.
So you might want to implement that step before that number-conversion step that migh sit somewhere in previous steps.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

charleshale
Responsive Resident
Responsive Resident

Aha!  A helper column essentially.  Genius solution!  

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.