Forum Discussion

unclejemima's avatar
unclejemima
Post Patron
7 years ago
Solved

Is Current Month Yesterday

Can anyone mod this forumla for me so it shows the current Month as yes no, but based on yesterday?   So example, if I ran the report on March 1st, it would still display Feb as it would read the d...
  • TomMartens's avatar
    7 years ago

    Hey,

     

    maybe this is what you are looking for:

    MonthTodayEqualsMonthYesterday = 
    var MonthYesterday = MONTH(TODAY()-1) --DATE(2017,4,24)
    var MonthToday = MONTH(TODAY())
    return
    IF(MonthToday = MonthYesterday, "Yes", "No")

    Or inside a Calendar table called Calendar it may look like this:

    MonthTodayEqualsMonthYesterday = 
    var MonthYesterday = MONTH('Calendar'[Date] - 1)
    var MonthToday = MONTH('Calendar'[Date])
    return
    IF(MonthToday = MonthYesterday, "Yes", "No")

     

    Regards,

    Tom