Forum Discussion

inesj's avatar
inesj
Frequent Visitor
2 years ago
Solved

Multiply average by value in related table

Hello!   I have a survey divided in different sections, each containing multiple questions. The average score for a section is based on the average score per question, multiplied by the question's ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi inesj ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create measures. 

    Average = CALCULATE(AVERAGE('Table3'[Score]),FILTER(ALLSELECTED('Table3'),[Question #]=MAX('Table2'[Question #])))
    Avg = [Average] * MAX('Table2'[Weight]) 
    Avg2 = 
    
    SUMX(SUMMARIZE(ALLSELECTED('Table2'),[Section],[Question #],"a",[Avg]),[a])
    Weighted Avg = CALCULATE([Avg2],FILTER('Table1',MAX('Table1'[Section]) in VALUES('Table1'[Section]) && MAX('Table2'[Question #]) in VALUES('Table2'[Question #])))

    (3) Then the result is as follows.

    Best Regards,

    Neeko Tang

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