Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

FIRSTNONBLANK Equivalent in Power Query

  Greetings.  I'm trying to do the equivelant of essentially a simple FIRSTNONBLANK without merging the query in Power Query (M) and haven't been able to figure it out/find a solution. In need o...
  • Omid_Motamedise's avatar
    1 year ago

    se my formula is 

    if [Original Order Number] = null then "" else Table.SelectRows(#"Changed Type",(x)=> x[Order Number]=_[Original Order Number] and x[Item Type]=[Item Type] and x[Lot Number]<>null)[Lot Number]{0}

    you remove the part trlated to  Table.SelectRows, pick add custom column and then copy and past all the formula I provided into the custom colu,mn formula, so your final formula for this step become like 

    = Table.AddColumn(#"Changed Type", "* Test2", each if [Original Order Number] = null then "" else Table.SelectRows(#"Changed Type",(x)=> x[Order Number]=_[Original Order Number] and x[Item Type]=[Item Type] and x[Lot Number]<>null)[Lot Number]{0})