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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Troubleshooting my "before this month" column

Hello Community -  This calculated column is giving me unexpected results.   Today is December 15 and I need the formula to register "true" for all dates prior to the current month.      Essentially, it is just a true/false column to allow me to filter out any months before the current month we are in.   Any suggestions?

 

texmexdragon2_0-1671107326631.png

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Anonymous 

 

try to add a column with this:

BeforeThisMonth = IF( FORMAT([Date], "YYYYMM") < FORMAT(TODAY(), "YYYYMM"), "Yes", "NO")
 
I tried and it worked like this:
FreemanZ_0-1671108562684.png

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @Anonymous 

 

try to add a column with this:

BeforeThisMonth = IF( FORMAT([Date], "YYYYMM") < FORMAT(TODAY(), "YYYYMM"), "Yes", "NO")
 
I tried and it worked like this:
FreemanZ_0-1671108562684.png
Anonymous
Not applicable

@FreemanZ    Thanks for the reply...you solution works fine but I ended up going with this:    

IsCurrentMonth = IF(AND(MONTH('Table Name'[Date])=Month(NOW()),YEAR('Table Name'[Date])=YEAR(NOW())),1,0)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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