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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Replace values for certain items in another column

Hello,

 

I want to replace some of the values of one column when it matches values from another query (table). I know I can use merge queries and conditional columns, but I do not want to use replace values.

E.g in the table below I need to replace the Department from "-" to "Sales" but not for every value in the Name column. Instead, I want to be able to provide the table with the names concerned (e.g just for Leo and Ken).

 

Any help is highly appreciated 😊

Name       Department

JoshIT
NathanServices
Leo_
Margaret_
Ken_
DenisIT
FloraServices
SandraServices
1 ACCEPTED SOLUTION
slorin
Super User
Super User

Hi

With Exception = {"Ken", "Leo"}

= Table.ReplaceValue(
Source,
each [Name],
each [Department],
(row,name,dep)=> if List.Contains(Exception,name) and dep="_" then "Sales" else dep,
{"Department"}
)

Stéphane 

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Works like a charm. Thanks a lot 😊

slorin
Super User
Super User

Hi

With Exception = {"Ken", "Leo"}

= Table.ReplaceValue(
Source,
each [Name],
each [Department],
(row,name,dep)=> if List.Contains(Exception,name) and dep="_" then "Sales" else dep,
{"Department"}
)

Stéphane 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.