Cubejs: use data from related table

I have the following schemas:
Project and Orders, with Orders being a hasMany relationship to Projects.

I need to create a measure in Projects that sums the column fee from all related Orders, so I have done the following

profit: {
      type: `sum`,
      sql: `${Orders}.fee`,
      shown: true
    }

which produces the error:

Error: 'Projects.profit' references cubes that lead to row multiplication. Please rewrite it using sub query.