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

Adding custom column causes "blank values error"

Hello,

 

I have a text column which contains in some rows only numeric entries and in other rows also text. I want to add now another column which takes the numeric values as they are and replaces all the text values by zeros. I do that like that:

 

 

= Table.AddColumn(#"Step before", "Column2", each try Number.From([Column1]) otherwise 0)

 

 

In the query editor this works perfectly. However as soon as I want to apply changes  I get the infamous  "Column 'Column3' in Table 'mytable' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table."-error.

 

This happens also if I break all relationships to this table. Note also that Column3 is mentioned in the error which is independent of Column1 and Column2 that are used for adding my custom column. Manually removing empty rows and nulls after adding my column also doesn't fix the problem.

 

Does anyone have a clue what I am doing wrong?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Finally I found the problem myself: the column that was mentioned in the error message was also a custom added column and I had added it with "Int64.type". For whatever reason this didn't cause any issues until I changed the type of the other column. Removing the "Int64.Type" from the first column, fixed the issue - although I don't have the slightest idea why because these two columns don't have anything to do with each other.

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Yeah, that doesn't make any sense if you do not have any relationships to that table.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Ok, I have to correct myself: Adding a column doesn't seem to be the source of the problem. If I manually filter out all the Text values in the column and then use 

= Table.TransformColumnTypes(#"Filtered Rows",{{"Column", type number}})

to create a numeric column it looks fine in the query editor but as soon as I apply the changes the error still appears. 

Anonymous
Not applicable

Finally I found the problem myself: the column that was mentioned in the error message was also a custom added column and I had added it with "Int64.type". For whatever reason this didn't cause any issues until I changed the type of the other column. Removing the "Int64.Type" from the first column, fixed the issue - although I don't have the slightest idea why because these two columns don't have anything to do with each other.

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