Power Query Tutorial: How to Conditionally Replace Values Without Creating New Columns

Pubblicato il: 02 aprile 2023
sul canale di: TECHQI
7,612
276

In this tutorial, I'll show you how to use conditional replacement in Power Query to transform and clean up your data. Conditional replacement is a powerful feature in Power Query that allows you to selectively replace values in a column based on a condition in another column.

We'll start by introducing you to the concept of conditional replacement and how it can help you manipulate and transform data in a variety of scenarios. We'll then dive into the practical steps of using the feature in Power Query, including creating a custom column, defining a condition, and replacing values based on that condition.

We'll provide examples and walk you through each step of the process so that you can follow along and try it yourself. By the end of this tutorial, you'll have a solid understanding of how to use conditional replacement in Power Query, and how it can help you clean and transform your data quickly and efficiently.

0:00 Intro and Problem
1:38 Custom Column Solution
3:37 Conditional Replace Solution
4:09 Fixing the Code

Microsoft Excel Tutorial - how to replace values without using custom columns? How to conditionally replace values in one step?

Using the formula:
= Table.ReplaceValue(#"Renamed Columns","X",
each if [ColumnA] = "X" and [ColumnB] = "Y" then "A"
else if [ColumnA] = "X" and [ColumnB] = "Z" then "B"
else [ColumnA],Replacer.ReplaceText,{"ColumnA"})

ColumnA = your replacement column
ColumnB = your reference conditional column
X is what you're replacing
Y = first conditional
A = what you want to change X to based on Y
Z = second conditional
B = what you want to change X to based on Z

#powerquery #powerquerytutorials #exceltutorial


In questa pagina del sito puoi guardare il video online Power Query Tutorial: How to Conditionally Replace Values Without Creating New Columns della durata di ore minuti seconda in buona qualità , che l'utente ha caricato TECHQI 02 aprile 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 7,612 volte e gli è piaciuto 276 spettatori. Buona visione!