cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

## Current Month Comparison

Hi everyone,

I need some help with a calculation. I need to create a new column that shows if an application has been returned the "Current Month." If the application has been returned the current month, it should be "YES." If an application has been returned in past months it should be "RESET," and if it has not been returned it should be "NO."
Example of what I need:

I am trying to use this formula, but I am not getting the result I need

Formula:

Aplication Returned = If(Contact[Most Recent Aplication return]= BLANK(), "NO", IF(Contact[Most Recent Aplication return] = date(year(today()),month(today())-1,1), "YES", "RESET"))

The result I get:

It must be something simple I am missing, but I can't seem to figure out.

1 ACCEPTED SOLUTION
Solution Sage

Think your IF statement is using incorrect logic, by the looks of thing it's only going to return yes if your return date is exactly the first of the previous month. Why not try something like:

Returned = var todaysdate = today()

if ([recentreturn] = blank(), "no", if (month([recentreturn])=month(todaysdate)&&(year([recentreturn])=year(todaysdate),"yes","reset")

i.e. compare the year and the month of your column to the year and the month of today and see if they both match

4 REPLIES 4
Solution Sage

Think your IF statement is using incorrect logic, by the looks of thing it's only going to return yes if your return date is exactly the first of the previous month. Why not try something like:

Returned = var todaysdate = today()

if ([recentreturn] = blank(), "no", if (month([recentreturn])=month(todaysdate)&&(year([recentreturn])=year(todaysdate),"yes","reset")

i.e. compare the year and the month of your column to the year and the month of today and see if they both match

Hi @jthomson!

Thank you for the response!

Community Support

hi, @joansinho

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

What I need!

@v-lili6-msft

What I get with the formula I am using

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors