Skip to content

Commit 0ec434b

Browse files
Merge pull request #816 from pohuan/dev/powei/add-sameperiodlastyear
Add special behavior for DAX function SamePeriodLastYear
2 parents 096b4d7 + 6b99f78 commit 0ec434b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

query-languages/dax/sameperiodlastyear-function-dax.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ The following sample formula creates a measure that calculates the previous year
4545
= CALCULATE(SUM(ResellerSales_USD[SalesAmount_USD]), SAMEPERIODLASTYEAR(DateTime[DateKey]))
4646
```
4747

48+
## Special behavior
49+
50+
When the selection includes last two days of month, SAMEPERIODLASTYEAR will use "extension" semantics and will include the days till the end of month. For example, when Feb 27 and 28 of 2009 are included in the selection, SAMEPERIODLASTYEAR will return Feb 27 to 29 of 2008.
51+
52+
This behavior only happens when last two days of month are included in the selection. If only Feb 27 is selected, it will go to Feb 27.
53+
54+
```dax
55+
= SAMEPERIODLASTYEAR(DateTime[DateKey])
56+
```
57+
4858
## Related content
4959

5060
[Time intelligence functions](time-intelligence-functions-dax.md)

0 commit comments

Comments
 (0)