Forum Discussion

powerboss1's avatar
powerboss1
Frequent Visitor
3 years ago
Solved

Dividing Columns Using Unique ID

Hello, I am attempting to divide two columns from two different tables using a unique ID. I do not want to sum both columns then divide. I am trying to divide "Total Square Footage by Territory"  by ...
  • Ritaf1983's avatar
    Ritaf1983
    3 years ago

    Unlike Excel, Power BI's engine "thinks" columns, not cells.

    Therefore, the only option I can see to achieve your goal is to add an index column at the territory level.
    Next, create an identification column based on the concatenation between the index and the territory.

    If you need a full demonstration, please attach 2 tables in a usable format

    (Not a picture)

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

  • johnyip's avatar
    johnyip
    3 years ago

    Assuming your table with Total Square Footage by Territory is 'Data 1', and another table is 'Data 2', you can create a calculated column in 'Data 2' as follows:

     

     

    Answer = LOOKUPVALUE('Data 1'[Total Square Footage by Territory],'Data 1'[Territory],'Data 2'[Territory]) /'Data 2'[Total by Territory]

     

     

    And as Ritaf1983 suggests, you should provide sample data in usable format in case your question is complicated that people need to actually work for it for the answer. Without the data structure and/or table name you may not able to get the answer as this can be crucial to the solution.