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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.