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
Hi,
I am looking to create a year over year comparison but based on the same date range. Basically I will have a selection date range which will take place in the current year, and I want to be able to show calculations for this year, as well as the sameperiod in a different variable year? So for example if I select the selection date range of Jan 30 2020 to Mar 28 2020, I want to be able to select another year say 2017, and it will show me the values for Jan 30 2017 to Mar 28 2017. I suspect this will be complicated but I want to check if it's possible and if I even want to attempt it.
Thanks
Solved! Go to Solution.
@id013 Probably some way using DATESINPERIOD perhaps or something else like that. Generally though, once you start to stray outside the lines a bit T"I" functions become more of a hassle than a help.
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
@id013
You can create a YearTable like below and provide a slider on the Year
| Year | YearNo |
| 2018 | -1 |
| 2017 | -2 |
| 2016 | -3 |
| 2015 | -4 |
| 2014 | -5 |
| 2013 | -6 |
Then use the measure to calculate :
Measure =
CALCULATE(
[Total Sales],
DATEADD('DATE'[Date], SELECTEDVALUE('YearTable'[YearNo]),YEAR)
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@id013 Probably some way using DATESINPERIOD perhaps or something else like that. Generally though, once you start to stray outside the lines a bit T"I" functions become more of a hassle than a help.
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 36 | |
| 29 | |
| 28 |
| User | Count |
|---|---|
| 127 | |
| 88 | |
| 78 | |
| 66 | |
| 65 |