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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rmcgrath
Advocate II
Advocate II

Help with replace values

Hello.  I have what I thought was going to be pretty simple.  Wherever CUSTOMER_ID = "VER999", I would like the PARENT_ID to be "COOP":

PARENT_IDCUSTOMER_ID
 EXE111
COOPJHY789
 VER999
COOPSYS654
 QWD321
 VER999
 LKJ871
COOPFSG557
 VER999

 

My strategy was a new Custom Column where I use the following:  

= Table.AddColumn(#"Cleaned Text1", "PARENT_ID_NEW", each if [Customer_ID] = "VER999" then [Parent_ID] = "COOP" else [Parent_ID])

 

Unfortunately, what I discovered is I am getting several "FALSE" values in the [PARENT_ID_NEW] column along with "COOP"; so it is putting in "COOP" for some of the "VER999" but not others?  Strange!  I've trimmed and cleaned so I don't understand what is causing it?

1 ACCEPTED SOLUTION
ajaybabuinturi
Impactful Individual
Impactful Individual

Hi @rmcgrath,
Your custom logic is almost correct. However that needs to be corrected to get expected results. You can use below code.

= Table.AddColumn(#"Cleaned Text1", "PARENT_ID_NEW", each if [Customer_ID] = "VER999" then "COOP" else [PARENT_ID])

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

View solution in original post

1 REPLY 1
ajaybabuinturi
Impactful Individual
Impactful Individual

Hi @rmcgrath,
Your custom logic is almost correct. However that needs to be corrected to get expected results. You can use below code.

= Table.AddColumn(#"Cleaned Text1", "PARENT_ID_NEW", each if [Customer_ID] = "VER999" then "COOP" else [PARENT_ID])

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.