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! Learn more

Reply
GabinAM
Frequent Visitor

Power Querry - Replace a boolean value True or False

Hello everyone ! 😊

I'm trying to replace boolean values based on another column condition.However and despite the absence of error, there is no modification at all on the table (the formula works perfectly to change non boolean values).

GabinAM_0-1706104495973.png

GabinAM_1-1706104919832.png


Could you please help ? Please find the Excel document and the Pbix here

Many thanks in advance ! 🙌

*If by any chance you also have a way to reduce the formula by avoiding "...or..." I would be very interested but I can deal with it !   

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try this

= Table.ReplaceValue(#"Changed Type",each [Direct Contact],each if List.ContainsAny({"Jodie","Anthony","Jonathan"},{[Sales]}) then false else [Direct Contact]   ,Replacer.ReplaceValue,{"Sales", "Direct Contact"})

View solution in original post

4 REPLIES 4
Ahmedx
Super User
Super User

pls try this

= Table.ReplaceValue(#"Changed Type",each [Direct Contact],each if List.ContainsAny({"Jodie","Anthony","Jonathan"},{[Sales]}) then false else [Direct Contact]   ,Replacer.ReplaceValue,{"Sales", "Direct Contact"})

Hi @Ahmedx it works! Just need to add one additional steps to change Data Type to Logical but otherwise, it's perfect! Many thanks for your help! Appreciate! 

Idrissshatila
Super User
Super User

HEllo @GabinAM ,

 

can you try to replace false with "false"



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!




Hello! I tried and indeed, it works on the test sample ! 😅

However, I think I forgot one key point... the column [Direct Contact] is Data Type = True/False and Under this format, the "false" doesn't work anymore... Please see below. 

GabinAM_0-1706106809836.png


I updated the Pbix in the dropbox folder. here 

 
Sorry and thank you again for you help! 

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.

Top Solution Authors