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

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

Reply
dhodgson
Frequent Visitor

Replace Column Values

Hi, 

 

I need to be able to replace all the values in the 'Trade Engagement' column to look like the below when 'EmployeeID' is NOT "1.Subcontractor" or blank. 

 

EmployeeIDTrade Engagement
CARLCompany
1.Subcontractor1.Subcontractor
ADAMCompany
  
JAMESCompany

 

Thanks in advance

1 ACCEPTED SOLUTION

btw, the first reply is for DAX, it works like:

FreemanZ_2-1681268614012.png

View solution in original post

5 REPLIES 5
FreemanZ
Super User
Super User

hi @dhodgson 

not very clear. do you mean something like:

Column =
IF(
    [EmployeeID] IN {"1.Subcontractor", BLANK()},
    [Trade Engagement],
   "Company"
)

That forumla isn't wokring. All I did was duplicate the EmployeeID column and renamed to 'trade engagement'. I then need to replace all values to 'Company' if they are not 1.subcontractor or a blank field. I tried using the below, however it replaces all text with "Company"; 

 

= Table.ReplaceValue(#"Renamed Columns1", each [Trade Engagement], each if [employeeid] <> "1.SUBCONTRACTOR" then "Company" else [Trade Engagement], Replacer.ReplaceText,{"Trade Engagement"})

btw, the first reply is for DAX, it works like:

FreemanZ_2-1681268614012.png

Apoloigies, was definitley doing this one wrong! This helps. Appreciate it. 

hi @dhodgson 

try to add a custom column like:

= Table.AddColumn(#"Changed Type", "Custom", each if [EmployeeID] ="1.Subcontractor" or [EmployeeID]=" "
then [EmployeeID]
else "Company")

 

it worked like:

FreemanZ_0-1681268353212.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.