Forum Discussion

sebbyp's avatar
sebbyp
Icon for Helper III rankHelper III
10 years ago

Find or refer to previous value using the date column

I would like to find or refer to the previous value in a time series so I can do a simple difference calculation between the current and the previous value.

 

The database i have has a date column, frequency, value.  Each time series has different reporting frequency such as monthly, quarterly, yearly.  I would like to be able to add another column in the database to show the prior value for the specific time series.  Is this possible when the database has varying reporting frequencies?

 

Any help would be much appreciated

22 Replies

  • Habib's avatar
    Habib
    Icon for Continued Contributor rankContinued Contributor

    If you want to refer to previous values in date hierarchy you can use DAX functions like PREVIOUSDAY, PREVIOUSMONTH, PREVIOUSQUARTER, PREVIOUSYEAR.

    If you want to refer to value available in previous row then you can use EARLIER function.

    • sebbyp's avatar
      sebbyp
      Icon for Helper III rankHelper III

      Thanks for your response.  I cannot use previous because the collection of time series in the single database has different reporting frequencies.  So the collection of time series in the data set can be reported on a daily, monthly, quarterly annually.  This doesn't help with previous functions. 

       

      I am not sure if the earlier function can work with this too.   Maybe i don't quite understand how this function works.  Please elaborate if you can.

       

      Thanks