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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Replace Value with conditions in advanced editor

Hey All,

Got stuck with the syntax.

I want to replace values in a column.

Replace all values from a column where value not starting with specific text.

How can I do it?

 #"Replaced Value" = Table.ReplaceValue(#"Added Custom Column",each if [Custom] <> Text.StartsWith([Custom], "day=""") then "" else "bla",Replacer.ReplaceText,{"Custom"})

Cheers!
A

2 REPLIES 2
jdbuchanan71
Super User
Super User

Hello @Anonymous 

What about doing it in a new custom column?

= Table.AddColumn(#"Renamed Columns", "New column", each if Text.StartsWith([Custom], "day=""""") then "" else [Custom])

replace.jpg

Then just delete the old column and rename the new one.

Anonymous
Not applicable

@jdbuchanan71 

Thats not a bad idea.

That is already a new custom column which I want to clean from leftovers.

But, I can do it. Create a new column and then maybe delete the original custom column.

Thnaks,

A

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.