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
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.