Returns a table that contains a column of all dates from the previous month, based on the first date in the dates column, in the current context.
Syntax
PREVIOUSMONTH(<dates>)
Parameters
| |
Term | Definition |
Dates | A column containing dates. |
Return Value
A table containing a single column of date values.
Example:
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), PREVIOUSMONTH('DateTime'[DateKey]))
Returns a table that contains a column of all dates from the previous quarter, based on the first date in the dates column, in the current context.
Syntax
PREVIOUSQUARTER(<dates>)
Parameters
| |
Term | Definition |
dates | A column containing dates. |
Return Value
A table containing a single column of date values.
Example: =CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), PREVIOUSQUARTER('DateTime'[DateKey]))
Returns a table that contains a column of all dates from the previous year, given the last date in the dates column, in the current context.
Syntax
PREVIOUSYEAR(<dates>[,<year_end_date>])
Parameters
| |
Term | Definition |
dates | A column containing dates. |
year_end_date | (optional) A literal string with a date that defines the year-end date. The default is December 31. |
Return Value
A table containing a single column of date values.
Ex: =CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), PREVIOUSYEAR('DateTime'[DateKey]))
More date and Time functions can be obtained from the link below:
https://msdn.microsoft.com/en-us/query-bi/dax/date-and-time-functions-dax
More of Time Intelligence functions:
https://msdn.microsoft.com/en-us/query-bi/dax/time-intelligence-functions-dax
No comments:
Post a Comment