Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Today()-7 datra in calculated column

Hi All,

 

Can we convert this measure into Calculated column?

 

Measure 3 = CALCULATE(MAX(Table1[Values]),FILTER(ALL(Table1),[Date]=MAX(Table1[Date])-7))

 

https://community.powerbi.com/t5/Desktop/Today-1-data-for-each-record/m-p/837285#M402108

 

Thanks in Advance.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Yes, just create index columns starting with 0 and 1 then merge teh table with itself

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Column = 
    VAR d = [Date] - 7
    RETURN
        CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', [Date] = d ) )