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
Magnus-CPH-DK
Helper I
Helper I

Problems merging queries - "DataFormat.Error: We couldn't convert to Number. Details:"

Hi all,

 

I am trying to merge the queries between two tables "Fact_Kontrolregister_A_&_D" and "VirkMain" but I keep getting the following error:

 

MagnusCPHDK_2-1658141768691.png

 

This is the relationship between the two tables in my data model ( I am not sure if this is relevant in this context):

 

MagnusCPHDK_1-1658141658288.png

 

The common key is "cvrNummer" which are both of the datatype "Whole Number". Therefore I do not understand why I receive the error message since the value already ought to be a number (which the cannot be converted to number...?). I cannot simply remove the rows since there might be several rows with the same issue.

 

After googling the error message I tried using "Trim" and "Clean" in order to remove potential whitespace in both columns. This did not solve the problem.

 

Any ideas of how to solve the problem? 

Thanks in advance!

(I have attached a couple of screenshots showing my process so far)MergeQueries2.pngDesktopPreview2.pngDesktopPreview1.pngMergeQueries1.png

5 REPLIES 5
Magnus-CPH-DK
Helper I
Helper I

Hi @ronrsnfld  and @v-stephen-msft .
Sorry for the long response tume, I have been away on vacation. But I still haven't found the solution.

Are you able to see the pictures from here?


The table names are slightly different, but the issue is the same: I want to merge the column "navn" from table "Dim_CVR" to table "Fact_Kontrolregister_A_&_D" via column "cvrNummer" which is a shared column between "Dim_CVR" and "Fact_Kontrolregister_A_&_D". "cvrNummer" is of the datatype Whole Number in both tables.

"cvrNummer" is the shared key between the two tables and is of type Whole Number. The arrow indicates the column I would like to merge."cvrNummer" is the shared key between the two tables and is of type Whole Number. The arrow indicates the column I would like to merge.Here I expand the merged tableHere I expand the merged tableThis is the convert to number error I keep getting. How come the number   30488687​​ cannot be converted to a number, when it is already a number?This is the convert to number error I keep getting. How come the number 30488687​​ cannot be converted to a number, when it is already a number?

Unfortunately, at this point, without sufficient data and code to reproduce the problem, I will not be able to help you further. Perhaps someone else can.  If not, perhaps you could create a file, with sensitive information removed, that will reproduce the problem (with data AND code) and upload it to some sharing site (eg OneDrive; DropBox) and then post a link here.

ronrsnfld
Super User
Super User

I, too, am having a problem with the size of the image. Which step returns the error? You have selected the last step, but there is not type conversion going on in that step. Please step backwards in the Applied Steps window until you see which step is actually throwing the error. 

Trim and Clean may not be enough as there may be NBSP ZWSP and other non-printing characters not affected by those functions.  But we need more information (and also visible data) in order to advise you better.

v-stephen-msft
Community Support
Community Support

Hi @Magnus-CPH-DK ,

 

Sorry, due to the size of your image, it is difficult for me to see the content, even when zoomed in.

Maybe you can try converting the offending column to text format, and then converting it to the type you need after the merge is complete.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @v-stephen-msft 
Thanks for your reply. Unfortunately, I cannot share the PBI file, since it contains sensitive data about citizens and conracts. 
I still havent found out why I get a data type convert error when the data is already numbers...

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.

Top Solution Authors
Top Kudoed Authors