Forum Discussion

Fred_PT's avatar
Fred_PT
Frequent Visitor
9 years ago
Solved

Accumulated vs Daily

Hi,   I'm trying to create a table where I have a column with values accumulated by product since the beginning of the month and need the value of only the day in a new column. I do not know if a n...
  • v-qiuyu-msft's avatar
    9 years ago

    Hi Fred_PT,

     

    You can create a calculated column like below:

     

    Value daily = var pre= CALCULATE(MAX(Table1[Value accum]), FILTER('Table1','Table1'[Product]=EARLIER(Table1[Product]) && 'Table1'[Date]<EARLIER('Table1'[Date])))
    return 'Table1'[Value accum]-pre

     

     

    Or create a measure:

     

    Measure = var p=CALCULATE(MAX('Table1'[Value accum]),FILTER(ALL('Table1'),'Table1'[Product]=MAX('Table1'[Product]) && 'Table1'[Date]<MAX('Table1'[Date])))
    return MAX(Table1[Value accum])-p

     

    Best Regards,
    Qiuyun Yu