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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
khampton
Frequent Visitor

DATEADD Function not working when using date heirarchy

I have just moved an SSAS tabular model with a live connection to PBI to directly importing the tables into PBI however the past year calculations do not seem to be working since I changed them over.

I'm using the following measures:

 

Revenue = SUM('Table1'[Revenue])

Prev Year = CALCULATE([Revenue], DATEADD('Date'[Date], -1, YEAR))
As per the screenshot below, this works when I use the date field in a chart. 

khampton_0-1720529288986.png

 

However when using a different field in the date table or even switching to the date hierarchy, this returns blanks.

khampton_1-1720529413927.png

 

Any ideas?

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@khampton 

Did you mark your date table as the date table in your model?

jdbuchanan71_0-1720530187593.png

If the Date table is not marked as the date table, time intelligence functions like DATEADD fail if you are looking at any field besides the date field.

It's because the model does not understand that Year / Quarter / Month columns are related to the Date[Date] column for use in time intelligence.

Once you mark it as a date table and identify the date column, all the other columns in the date table will also work for time intelligence functions.

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@khampton 

Did you mark your date table as the date table in your model?

jdbuchanan71_0-1720530187593.png

If the Date table is not marked as the date table, time intelligence functions like DATEADD fail if you are looking at any field besides the date field.

It's because the model does not understand that Year / Quarter / Month columns are related to the Date[Date] column for use in time intelligence.

Once you mark it as a date table and identify the date column, all the other columns in the date table will also work for time intelligence functions.

Always an oversight somewhere, thank you!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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