Forum Discussion

Fab117's avatar
Fab117
Icon for Helper IV rankHelper IV
3 years ago
Solved

Calculation on table 2 reported in table 1

Hi,   I'm looking to do a calculation on table 2 value (based on a code id) which should be reported in Table 1 (connected to Table 2 through the same code id).   To illustrate:   My sources: ...
  • MFelix's avatar
    MFelix
    3 years ago

    Hi Fab117 ,

     

    To add this has a column you need to use the following sintax:

    Average Price = 
    AVERAGEX (
       FILTER('Table 2', 'Table 2'[Code] = 'Codes Table'[Code]),
        DIVIDE('Table 2'[Price for number of units considered] , 'Table 2'[Number of units])
    )

     

     

     

    You can also do this directly on the table 1 instead of having this bridge table if the values on table 2 are only to calculate the average price.

     

    File attach.