cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
unclejemima Member
Member

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 day previous to the current month.

 

Here is what I have now displaying the current month...

 

IsCurrentMonth = 
    IF (
        YEAR ( 'Calendar'[Date].[Date] ) = YEAR ( TODAY () )
            && MONTH ( 'Calendar'[Date].[Date] ) = MONTH ( TODAY () ),
        "True",
        "False"
    )
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Is Current Month Yesterday

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")

image.png

 

Regards,

Tom

 

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
3 REPLIES 3
Super User
Super User

Re: Is Current Month Yesterday

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")

image.png

 

Regards,

Tom

 

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
unclejemima Member
Member

Re: Is Current Month Yesterday

Hmmmmm...Interesting.  I will give this a try.  Thanks!

Community Support Team
Community Support Team

Re: Is Current Month Yesterday

Hi @unclejemima 

Is this problem sloved?

If not, please let me know.

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.