Check if values equal each other, then sum other values of that row.

I have two Tables, main and form. I want in the form table a row "average" to be the sum of the "grade" divided by the sum of the "weight", but only when the "subject" rows in the main and form table are the same.

Now i got something like this: SUM(main[grade]) / SUM(main[weight]), but it averages every grade from every subject.

0 1 96
1 REPLY 1


@Himeji wrote:

main[grade]


This is a list of all values in the "grade" column of the "main" table. Use a function to filter that list only to the values you want. For example:

SELECT(main[grade], [subject] = [_THISROW].[subject])

Depending on whether and how you have created any References between tables, you might have even more efficient options by leveraging reverse references or Dereference expressions. For example:

SUM([Related mains][grade])

 

Top Labels in this Space