Forum Discussion

sfink22's avatar
sfink22
Helper I
7 years ago
Solved

DAX to sum column based on another table

Hello! Trying to work out the right equation to sum a column based on another table for a budget dashboard. Here is my setup:   Table 1 has the budget info by period, like this: Period    Budget ...
  • v-cherch-msft's avatar
    7 years ago

    Hi sfink22

     

    You may create calculated columns as below:

    Column =
    SUMX (
        FILTER ( 'Table 2', 'Table 2'[Period] = 'Table 1'[Period] ),
        'Table 2'[Amount]
    )
    
    Column 2 =
    SUMX (
        FILTER ( 'Table 1', 'Table 1'[Period] <= EARLIER ( 'Table 1'[Period] ) ),
        'Table 1'[Column]
    )
    

    Regards,

    Cherie