Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
unclejemima
Post Patron
Post Patron

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
TomMartens
Super User
Super User

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

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

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.

TomMartens
Super User
Super User

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

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.