cancel
Showing results for
Did you mean:
Highlighted
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

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

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

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

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!
Member

## Re: Is Current Month Yesterday

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

Community Support Team

## Re: Is Current Month Yesterday

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.