Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to find average from 2 different table

hello Guys, Hope you are doing well.  May I know how can I calculate the average score from 2 different table that have one to many relationship ? kindly refer to the example below.  Table in yello...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

    Avg expected result CC = 
    DIVIDE (
        SUMX ( RELATEDTABLE ( Score1 ), Score1[Score] )
            + SUMX ( RELATEDTABLE ( Score2 ), Score2[Score] ),
        COUNTROWS ( RELATEDTABLE ( Score1 ) ) + COUNTROWS ( RELATEDTABLE ( Score2 ) )
    )