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
HamidBee
Impactful Individual
Impactful Individual

What does '.[Date]' mean in the DAX function below?

I'm not sure what '.[Date]' means in the following expression.

 

PY Sales=CALCULATAE(SUM(Sales[Sales]),DATEADD('Calendar'[Date].[Date],-1,YEAR))

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

When you don't have a custom date table and are using Power BI's built in dates for time intelligence, each date column automatically gets several fields associated with it so that you can access different date parts.

'Calendar'[Date].[Year] would return the year portion of the date, for example.

In the formula you show then the .[Date] portion is redundant as it will just return the same value as 'Calendar'[Date], so you could replace the formula with

PY Sales=CALCULATE(SUM(Sales[Sales]),DATEADD('Calendar'[Date],-1,YEAR))

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

When you don't have a custom date table and are using Power BI's built in dates for time intelligence, each date column automatically gets several fields associated with it so that you can access different date parts.

'Calendar'[Date].[Year] would return the year portion of the date, for example.

In the formula you show then the .[Date] portion is redundant as it will just return the same value as 'Calendar'[Date], so you could replace the formula with

PY Sales=CALCULATE(SUM(Sales[Sales]),DATEADD('Calendar'[Date],-1,YEAR))
HamidBee
Impactful Individual
Impactful Individual

Thanks for the clarification.

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.