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
SammiF1244
Helper I
Helper I

I am unable to get my query to run due to an issue with my replaced value.

I am sure it is my own error, as I am new, but I do not recall changing anything. 

The replace values I need to allow the column to remain, but the row data needs to be blanked out. I found a trick to change the data type to one that will produce an error, replace error, then change data type back (and changed all the other data types to text --needed for a software import data requirement). When I added that code, it saved with no syntax error, but when the query runs it shows this.  I hope this makes sense. (THANK YOU--- this group has been great!! I hope I can start giving back soon :))

SammiF1244_2-1698988820755.pngSammiF1244_3-1698988873539.png

 

Here is the full code:

 

let
Source = Table.Combine({#"Aldera ADD", #"Aldera DELETE", #"Aldera MODIFY"}),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Relation", Percentage.Type}}),
#"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type", {{"Relation", 0}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Errors",{{"Relation", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type1",null,"",Replacer.ReplaceValue,{"Relation"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","0","",Replacer.ReplaceText,{"Relation"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Replaced Value1",{{"Effective_Date", type text}, {"Termination_Date", type text}, {"DateTimeModified", type text}, {"Key_2", type text}, {"Key_3", type text}, {"Key_4", type text}, {"Key_5", type text}, {"Key_6", type text}, {"Key_7", type text}, {"Key_8", type text}, {"Key_9", type text}, {"Key_10", type text}, {"Type", Int64.Type}})
in
#"Changed Type2"

2 ACCEPTED SOLUTIONS
rubayatyasmin
Super User
Super User

Hi, @SammiF1244 

 

check if the relation column value contains all percentage convertable values. If not then it will produce error. Also check for the change type2 where you are changing the type of several cols. make sure every column value is convertable to integer. 

 

Also,  try to check every query steps to find out which step is generating errors. 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

SammiF1244
Helper I
Helper I

Replace values with blanks using the data type work around is throwing an error no matter what I try. So, I deleted the column, added a new column as ="" with the same name and reordered it. It worked :). 

View solution in original post

2 REPLIES 2
SammiF1244
Helper I
Helper I

Replace values with blanks using the data type work around is throwing an error no matter what I try. So, I deleted the column, added a new column as ="" with the same name and reordered it. It worked :). 

rubayatyasmin
Super User
Super User

Hi, @SammiF1244 

 

check if the relation column value contains all percentage convertable values. If not then it will produce error. Also check for the change type2 where you are changing the type of several cols. make sure every column value is convertable to integer. 

 

Also,  try to check every query steps to find out which step is generating errors. 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


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