Forum Discussion
Anonymous
6 years agoNot applicable
Replacing values in multiple columns based on condition in Power Query
Hello, I have a table like this: Date plan unplan internal external production day flag 1/1/2020 0 0 50 70 6000 Production ...
Rickmaurinus
Helper V
4 years agoAnother way to do it, is the unpivot your columns, and then on the newly created column apply a conditional replace operation.
= Table.ReplaceValue(
#"Changed Type",
each [Value],
each if [day flag] = "Down Day" then null else [Value],
Replacer.ReplaceValue,{"Value"}
)
You can find the details on the conditional replace right here:
https://gorilla.bi/power-query/replace-values/#conditionally-replace-values
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.