Power Query Table - add formula if

aam1932

Board Regular
Joined
Jun 2, 2010
Messages
182
Hai

How to add formula if in Power query table. The formula as below

AbFormulaFinal result
AAAif(column B = empty, used description column a, used columb bAAA
AAAAAA
BAAABBBB
aacccccc

<tbody>
</tbody>

Thank you
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Here you go:

Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"A", type text}, {"b", type text}}),
    #"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom", each if  = null then [A] else  )
in
    #"Added Conditional Column"



Excel 2010
ABCDEFG
1AbAbCustom
2AAAAAAAAA
3AAAAAAAAA
4BAAABBBAAABBBB
5aacccaacccccc
6
Sheet1
 
Last edited:
Upvote 0
Add custom column, then use formula below - i changed column headers to col1 and col2 rather than A and b

=if [Col1]=null then [Col 2] else [Col1]

Hope it helps
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,443
Members
449,453
Latest member
jayeshw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top