Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Add column with same calculation

neeHi I hope some body can help me!  I have 2 tables, one with dates and one with values, they are connected.  I then what to calculate the sum of the last month and insert the value in a column...
  • amitchandak's avatar
    5 years ago

    @Snip , Create a new column as

    Column = sumx(FILTER('Table',EOMONTH([date],0) =EOMONTH(max([Date]),0)),[Value])
  • v-xuding-msft's avatar
    5 years ago

    Hi Anonymous ,

     

    Please try this:

    Measure =
    VAR mon_ =
        CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
    RETURN
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                ALL ( 'Date' ),
                'Date'[Month] = MONTH ( mon_ )
                    && MAX ( 'Table'[Value] ) <> BLANK ()
            )
        )