Forum Discussion
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.
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))
2 Replies
- johnt75Super 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))- HamidBeePower Participant
Thanks for the clarification.