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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Replacing Existing Value based on 2 columns

Hi 

 

I have 2 columns in a table and I need to replace 1 value in one of the existing columns based on the value of the second column but leave the rest of the values unchanged. 

 

Column 1 = Rule Category

Column 2 = Regulator of rule(s) breached

 

I need to change the value if [Rule Category] = "Communications" and [Regulator of rule(s) breached] = "Information Commissi" then replace [Rule Category] = "Communications" as "Data Protection" but all other values in [Rule Catagory] remain unchanged. 

 

is there a quick and easy way to do this without having to do this manually?

3 REPLIES 3
Idrissshatila
Super User
Super User

Hello @Anonymous ,

 

add the following as a calculated column

 

Column = IF('Table'[Rule Category] = "Communications" && 'Table'[Regulator of rule(s) breached] = "Information Commissi" , "Data Protection",'Table'[Rule Category])

Idrissshatila_0-1697449548725.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Anonymous
Not applicable

Apologies this was supposed to be in the Power Query forum and posted here by mistake @Idrissshatila 

if you want it in power query it would work as well,  just add a new custom column and add the following formula

 

if [Rule Category] = "Communications" and [#"Regulator of rule(s) breached"] = "Information Commissi" then "Data Protection" else [Rule Category]

Idrissshatila_0-1697451399085.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.