PQ: If column is null make vlookup

mklinge

New Member
Joined
Feb 16, 2015
Messages
20
So I have this PQ that merges two tables. In on eof the tables theres a column called 'Bib#' - the other does not have this. I want the column populated when the column is empty.

The second tables holds another column ('Data'), that can be used to find the corresponding value ('Bib') to inset into'Bib#' from a third table ('Runners').

I have this script that has the lookup working perfect, but it adds another column, which I would perfer not to do. Perhaps somebody here can help me rewrite it to simply update 'Bib#' if null?

Power Query:
= let
    Source = UniqueID,
    AddDebugColumns = Table.AddColumn(Source, "BibNo", each
        if [Data] = null then null else
            let
                LookupTable = Runners,
                LookupValue = [Data],
                MatchingRows = Table.SelectRows(LookupTable, each [ChipID] = LookupValue),
                LookupResult = if Table.RowCount(MatchingRows) > 0 then MatchingRows{0}[Bib] else null
            in
                LookupResult)
in
    AddDebugColumns
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,215,080
Messages
6,123,013
Members
449,093
Latest member
ikke

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