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
Reggie
Regular Visitor

DAX January Issue

I have a DAX formula that I have currently been using and up until recently it had been working like a dream. We have now entered a new year and it seems to have broken. 

 

I am creating a report that shows whether a sum of money is current, one month overdue or two months +. My problem is that I cant seem to write the correct formula to have

January 2019 as the current month

December 2018 as overdue by 1 month

November 2018 as overdue by two months.

 

My thought process was that I could use YEAR(TODAY()) -1 to return last year but that doesnt seem to work and I have done research and cant find the correct answer.

 

The formula I am currently using that worked is pasted below but again does not work in January 

 

Status = IF('Customer/CustOpen'[date].[Year]=YEAR(TODAY()),SWITCH('Customer/CustOpen'[date].[MonthNo],MONTH(TODAY()), "Current",MONTH(TODAY())-1,"One Month","Two Months +"))
 
Thank you in advance for your help 🙂 
1 REPLY 1
v-danhe-msft
Employee
Employee

Hi @Reggie,

Could you please share some sample data to have a test if possible?

 

Regards,

Daniel He

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

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.