Forum Discussion

Justas4478's avatar
Justas4478
Post Prodigy
1 year ago
Solved

Power query division without merging tables?

Hi, I have this calculated column in report view: DIVIDE('Stock take file new'[Absolute Difference Quantity],RELATED('Product information'[Pick to Base UoM Quantity])) I do need to recreate it usi...
  • BeaBF's avatar
    1 year ago

    Justas4478 Hi! If you don't want to merge, you can look up values from the second table dynamically, something like:

     

    Table.AddColumn(#"Previous Step", "Calculated Column", each
    Value.Divide(
    [Absolute Difference Quantity],
    List.First(
    Table.SelectRows(
    #"Product information",
    each [Product ID] = _[Product ID]
    )[Pick to Base UoM Quantity],
    null
    )
    )
    )

     

    If performance is a concern and you want a cleaner approach, merging tables is the best way to go. If merging is not an option due to constraints, then the Table.SelectRows method can work but will be slower for large datasets.

     

    BBF