Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
Solved! Go to Solution.
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))
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))
Thanks for the clarification.