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
sureshsonti
Helper II
Helper II

Current Date Today convert to Last Year Date

Hello,

I am using the Direct Query Mode to extract my data from SQL Server. I have a column with CurDate which shows the current date as of today. Is there a DAX formula that can use the CurDate column and get me Last Year Date as of today.

 

Example

CurDate: 12/31/2018 vs Last Year Date: 12/31/2017 

 

Thanks

1 ACCEPTED SOLUTION

@sureshsonti

Or you could also do:

 

DATE(YEAR([CurDate])-1;MONTH([CurDate]);DAY([CurDate]))

View solution in original post

6 REPLIES 6
AlB
Super User
Super User

Hi @sureshsonti

 

check out DATEADD( ) or PARALLELPERIOD( )

@sureshsonti

Or you could also do:

 

DATE(YEAR([CurDate])-1;MONTH([CurDate]);DAY([CurDate]))

That formula worked. Thanks for your help. I have one more question

 

Is there a DAX statement to get Today's Date that is dynamic which changes everyday. Trying to avoid TODAY() or NOW(). I have a column which is Order Date in my database.

 

Thanks for your help 

@sureshsonti

I do not know of any others than  TODAY()  and NOW(). What is the problem with those?

When I use TODAY() or NOW() functions in any DAX statements and when I upload the PBIX file to Power BI Services after 6 PM I dont see today's information or data, I get tomorrow's data. I found this link which looks like Power BI Services are 6 hours ahead. I live in Baton Rouge, Louisiana. So my report will be showing tomorrow's data at 6 PM today. But Power BI Deskop is still showing today's data. Only on the Power BI Services I have this issue. Hope this makes sense.

 

https://www.worldtimebuddy.com/utc-to-united-states-louisiana-baton-rouge

 

 

@sureshsonti

 

I see. I'm not sure about that. Maybe you should post the question on the "Service" forum?

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.

Top Solution Authors