Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I need a Power Query M formula version for creating a "column D" that does a VLOOKUP from TableB on colA but if it doesn't exist, then just pull col C from the original TableA.
TableA and TableB has a many:one relationship set-up.
In excel formula this would be:
col D = IF(VLOOKUP(... ), COLUMN_IN_TABLE_A, VLOOKUP(... )
TableA:
| col A | col B | col C |
| A | 1 | apple |
| A | 23 | banana |
| B | 3 | cherry |
| C | 4 | daisy |
TableB:
| col A | col B |
| A | dd |
| B | cc |
Wanted Final Result:
| col A | col B | col C | col D |
| A | 1 | apple | dd |
| A | 23 | banana | dd |
| B | 3 | cherry | cc |
| C | 4 | daisy | daisy |
THANKS!!
Solved! Go to Solution.
=Table.AddColumn(TableA,"col D",each TableB{[#"col A"=[col A]]}?[col B]? ??[col C])
the values must be unique in col A of TableB .
Hi nimblecat.
Is this the kind of thing you're looking for?
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 6 | |
| 6 | |
| 5 |