Forum Discussion

Janaki's avatar
Janaki
Regular Visitor
9 years ago
Solved

dax previousmonth

Hi,   I am trying use PREVIOUSMONTH to get the previous month value. My data looks like this     I calculated previous from current value using PREVIOUSMONTH, but i get one extra month Mar...
  • Eric_Zhang's avatar
    Eric_Zhang
    9 years ago

    Janaki wrote:

    Hi,

     

    Thank you. The currentvalue that I am using is a measure. Would you have a alternate suggestion? 


    Janaki

    Then just try

    Previousvalue =
    IF (
        ISBLANK ( MAX ( xyz[ReportDate] ) ),
        BLANK (),
        CALCULATE (
             'xyz'[CurrentValue],
            PREVIOUSMONTH ( dimdate[Date].[Date] )
        )
    )