Forum Discussion

bwanRPD's avatar
bwanRPD
Frequent Visitor
6 years ago
Solved

How to divide two different values on two different tables, by the related value on both tables?

Hi,   I have two tables that each has one field in common, for example, both tables have a column containing Color (see below example). I want to be able to, in a Matrix, sum the size of Table 1 a...
  • Anonymous's avatar
    Anonymous
    6 years ago

     

    bwanRPD 


    Try create this measure in Table 1:

    Result = 
    var sumbycolor = CALCULATE(SUM(Table1[Size]),ALLEXCEPT(Table1,Table1[Color]))
    var staffno = CALCULATE(SUM('Table2'[Staff]),FILTER(Table1,Table1[Color]=RELATED(Table2[Color])))
    Return DIVIDE(sumbycolor,staffno)

     


    Best,
    Paul