Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello,
I'm having an issue getting Prior Year to Date Sales to work the way I want.
I use the following measures:
Most recent day selected:
I have tried changing the PYTD formula to use quarter and days instead of year. Days worked as I wanted it to, however, using -365 days only works on non-leap years. On a leap year (2020 for instance) it pulls the first day of of the year instead. Also, I would imagine that any day's data past February will be off by 1 for prior year.
There are many more issues at play here. First your data source must be in import mode (this will not work in Direct Query mode). Next you must refresh that data source daily. Then you need to add a "Is Past in Previous Year" flag that is based on your last transaction date minus one year.
And then you can start thinking about the local seasonality. 1st of February this year is guaranteed to be on a different weekday than 1st of February last year. This is much more impactful that the added one day in a leap year.
Thankfully you're not attempting to do Month over Month. That's where it becomes really ugly.
Hello! I apologize for the delay.
What I'm hearing is, that it is easier for me to update the date filter manually until I can hire a coder to specially design it to consider the time periods over months, quarters, and years.
Thank you for giving me that level of context as it has helped me prioritze where to spend my time.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 78 | |
| 40 | |
| 31 | |
| 27 | |
| 27 |