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
PBI_Curve
Helper I
Helper I

Filter for all after this month

This might exist already but I've searched for the different phrasings I could think of.

 

I have 2 sets of values merged together, 1 is forecasts and the other is actuals. I use a basic If formula to show me the actuals if the associated date is on or before today, and the forecasts if the associated date is in the future. I need to change this from "everything after today" to "everything after this month".

 

At the moment, my formula is set as:

if ('Value'[date]<=now(), 'show me actual', 'show me forecast')

 

This filters out everything dated after today but still shows values that are dated later in this same month. 

Is there a simple way to just replace 'now()' with 'This Month' in some way?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hey @PBI_Curve

 

I would recommend using the MONTH function to return the month number of NOW(). Also assuming that your data might have multiple years, you need to also specify that the year number of your data is less than the year number of NOW().

 

if (MONTH('Value'[date])<=MONTH(now()) && YEAR('Value'[date])<=YEAR(now()), 'show me actual', 'show me forecast')

Hope this helps,

Parker

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hey @PBI_Curve

 

I would recommend using the MONTH function to return the month number of NOW(). Also assuming that your data might have multiple years, you need to also specify that the year number of your data is less than the year number of NOW().

 

if (MONTH('Value'[date])<=MONTH(now()) && YEAR('Value'[date])<=YEAR(now()), 'show me actual', 'show me forecast')

Hope this helps,

Parker

Thanks @Anonymous, worked a treat!

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.