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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Maz_0102
Helper I
Helper I

Replace Values using a condition

Hi

 

I want to repace some values in a column based on part of the value they all share

 

as an exampke, I want to replace all these values from the filter to "London" on the condition if they contain "N1"

 

can anyone please help

 

Maz_0102_0-1646913003017.png

 

 

1 ACCEPTED SOLUTION

Hi @Maz_0102 ,

In the same column, it can only replace the "N1" part, not the entire cell, like this:

vkalyjmsft_0-1647412333906.png

vkalyjmsft_1-1647412365197.png

Get the result.

vkalyjmsft_2-1647412396681.png

If you want to replace the entire cell, you should add a custom column, then you can remove the original column.

vkalyjmsft_3-1647412557936.png

Custom = if Text.Contains([Column1], "N1") then "London" else [Column1]

Get the result.

vkalyjmsft_4-1647412672758.png

Then remove column1 if you needed.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

3 REPLIES 3
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

you can do this over power query: https://support.microsoft.com/en-us/office/replace-values-power-query-28256517-f1e9-4dc3-832f-45786e...

or create a new column using a condition like 

New column = if(contains(column name; "CN 03", value if true, value if false)

contains function: https://docs.microsoft.com/en-us/dax/contains-function-dax 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Hi

 

how can i do this in power query editor in power bi

 

sorry, where is the option for this and i want to keep same column but replace few valueas

Hi @Maz_0102 ,

In the same column, it can only replace the "N1" part, not the entire cell, like this:

vkalyjmsft_0-1647412333906.png

vkalyjmsft_1-1647412365197.png

Get the result.

vkalyjmsft_2-1647412396681.png

If you want to replace the entire cell, you should add a custom column, then you can remove the original column.

vkalyjmsft_3-1647412557936.png

Custom = if Text.Contains([Column1], "N1") then "London" else [Column1]

Get the result.

vkalyjmsft_4-1647412672758.png

Then remove column1 if you needed.

 

Best Regards,
Community Support Team _ kalyj

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.