Forum Discussion
renee_crozier
Mar 06, 2025Brass Contributor
Replacing Value Based on Two Conditions in Power Query
I have a list of people who have access to a certain Site Collection and Subsite. I am trying to replace a value in the Subsite column using an If-Else statement in Power Query to only replace one va...
- Mar 06, 2025
= Table.ReplaceValue(#"Filtered Rows", each [Subsite], each if [SiteCollection]="en_ca" and [Subsite]="D26 Plumbing" then "D26 Plumbing & Bath" else [Subsite] , Replacer.ReplaceValue,{"Subsite"})
Does this return the intended result?
OliverScheurich
Mar 06, 2025Gold Contributor
= Table.ReplaceValue(#"Filtered Rows", each [Subsite], each if [SiteCollection]="en_ca" and [Subsite]="D26 Plumbing" then "D26 Plumbing & Bath" else [Subsite] , Replacer.ReplaceValue,{"Subsite"})
Does this return the intended result?
- renee_crozierMar 06, 2025Brass Contributor
It did! For my knowledge, the Replacer at the end of the code is just there to say where the replacement is taking place and has no important to the main if-else statement? I think that's what was tripping me up the most