Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
Need to show the Same Period Last Year from a measure, but the result shows the Year To Date value.
LYTD =
Already tried this basic formula and many variations using PARALLELPERIOD, DATEADD, etc. but the result allways shows YTD instead of SPLY.
Will appreciate any suggestion.
Thanks beforehand
Solved! Go to Solution.
Hi, @eduardoa
Meaning, today's date is August 2nd, 2023, then the SAMEPERIODLASTYEAR function returns dates from January 1, 2022, to August 2, 2022, hence why it looks like a YTD calculation.
* Do you want to calculate [my measure] for the complete previous year? then use DATEADD
* if you want to calculate [my measure] for the complete previous year till today's date, use DATESYTD with DATEADD.
for example.
DATESYTD( DATEADD(DimDates[Date], -1, YEAR) )
this would calculate [my measure] for the period from jan 1, 2022, to aug 2, 2022 as today is aug 2, 2023.
refer: https://learn.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
https://learn.microsoft.com/en-us/dax/dateadd-function-dax
https://learn.microsoft.com/en-us/dax/datesytd-function-dax
see if this thread helps you
Solved: SAMEPERIODLASTYEAR() - Microsoft Fabric Community
Proud to be a Super User!
Hi, @eduardoa
Meaning, today's date is August 2nd, 2023, then the SAMEPERIODLASTYEAR function returns dates from January 1, 2022, to August 2, 2022, hence why it looks like a YTD calculation.
* Do you want to calculate [my measure] for the complete previous year? then use DATEADD
* if you want to calculate [my measure] for the complete previous year till today's date, use DATESYTD with DATEADD.
for example.
DATESYTD( DATEADD(DimDates[Date], -1, YEAR) )
this would calculate [my measure] for the period from jan 1, 2022, to aug 2, 2022 as today is aug 2, 2023.
refer: https://learn.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
https://learn.microsoft.com/en-us/dax/dateadd-function-dax
https://learn.microsoft.com/en-us/dax/datesytd-function-dax
see if this thread helps you
Solved: SAMEPERIODLASTYEAR() - Microsoft Fabric Community
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |