Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

SUMX FROM 2 DIFFERENT TABLES (DAX)

Hi Guys,   Newbie here !   Just wanna ask how to sumx from 2 different tables?   Thank you!  
  • Jimmy801's avatar
    6 years ago

    Hello Anonymous 

     

    just sum them 🙂

    sumxtwice = SUMX('Table1';'Table1'[Column1])+SUMX('Table2';'Table2'[Column2])

     

    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

  • edhans's avatar
    6 years ago

    If you need a single SUMX for two fields in different tables, use something like the following:

     

    Measure =
    SUMX(
       TableName,
       TableName[Field] * RELATED(TableName2[DifferentField])
       )

    The tables have to have a relationship, and this assumes you are going from the many table to the one table. For example, you are multiplying quantities in a sales fact table against the cost of goods from a product dimension table.