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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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