Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Today-1 data for each record

Hi All,

 

I have two columns date and values. I would like to generate a new column which will show previous days values. How can i achieve that?

 

Thanks and Regards

  • Hi Anonymous 

     

    This could help:

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

     

4 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Anonymous ,

    Try this:

    Yesterday = 
    var _cdate = MAX('Table'[date])
    var _calc = Calculate(MAX('Table'[values]),ALL('Table'),'Table'[date]<_cdate)
    
    return _calc

     


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
    Nathaniel 

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

    Hi Anonymous 

     

    This could help:

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

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-diye-msft 

       

      Can we achieve this via Calculated Column instead of Measure?

       

      Regards,

      Prakash