Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
delmayhan
Frequent Visitor

Dateadd in previous Year

Hi all,

i created a column of the current date = today()  and important to know today is 03/01/2023

delmayhan_0-1672758643742.png

What we do is taking a snapshot 10 days after each quarter. And from there on i create a column to see the previous quarter.

delmayhan_1-1672759279943.png

 

So with this formule i want to see the quarter of the previous year only i see now blank values. The Dateadd functions doesn't work for previous year. If i change the formule in -1 day than i does work. And if i change it into -10 days than is doenst work anymore because it is in the previous year.  I read only that the dateadd function only work for date values when the excist in the datetable. I wondering how does it still work when i have a current date of today() and the formule still work if i add +3 Months when there is no date data because i am revering to the current date and that is only today. How can this work for in the previous year?

 

delmayhan_2-1672759613459.png

 

 

1 ACCEPTED SOLUTION

@delmayhan 
Please try 

1.png

Date of previous quarter = 
VAR CurrentDate = 'Issue snapshot'[Current Date]
VAR AdjustedDate = CurrentDate - 10
VAR Days = DAY ( AdjustedDate )
VAR PreviousDate = EOMONTH ( AdjustedDate, - 4 ) 
RETURN
    PreviousDate + Days

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @delmayhan 

can you please provide the expected results?

Hi @tamerj1 i expect the result ; Current date = Today() (03-01-2023 -10 days) = 24-12-2023 That is Q4 and then -1 quarter = Q3 So i Expect dates from Q3. Like 24-09-2022

 

delmayhan_0-1672827124546.png

You can test it yourself creating a column of today and then the above DAX formule, i expect data in the year 2022 but i get blank values back.

 

 

 

@delmayhan 
Please try 

1.png

Date of previous quarter = 
VAR CurrentDate = 'Issue snapshot'[Current Date]
VAR AdjustedDate = CurrentDate - 10
VAR Days = DAY ( AdjustedDate )
VAR PreviousDate = EOMONTH ( AdjustedDate, - 4 ) 
RETURN
    PreviousDate + Days

Thankyou @tamerj1  it works!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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