cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sureshsonti Regular Visitor
Regular Visitor

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

Accepted Solutions
Super User
Super User

Re: Current Date Today convert to Last Year Date

@sureshsonti

Or you could also do:

 

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

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Current Date Today convert to Last Year Date

Hi @sureshsonti

 

check out DATEADD( ) or PARALLELPERIOD( )

Super User
Super User

Re: Current Date Today convert to Last Year Date

@sureshsonti

Or you could also do:

 

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

View solution in original post

sureshsonti Regular Visitor
Regular Visitor

Re: Current Date Today convert to Last Year Date

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 

Super User
Super User

Re: Current Date Today convert to Last Year Date

@sureshsonti

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

sureshsonti Regular Visitor
Regular Visitor

Re: Current Date Today convert to Last Year Date

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

 

 

Super User
Super User

Re: Current Date Today convert to Last Year Date

@sureshsonti

 

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 6 members 924 guests
Please welcome our newest community members: