March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to find the net difference between previous years data based on a period using a slicer. The slicer uses the WEEKNUM column from my Calendar table. I have a measure that gives me a rate from my Data table. I created another measure to give me the rate for the previous year using:
PrevRate = CALCULATE([CurRate], SAMEPERIODLASTYEAR('calendar'[Date])
In the visual I am getting weird results
Weeks 1 to 39:
Year | CurRate | PrevRate |
2017 | 312.16 | |
2018 | 295.82 | 314 |
2019 | 298 |
Weeks 5 to 36:
Year | CurRate | PrevRate |
2017 | 293.99 | |
2018 | 274.58 | 294 |
2019 | 282 |
It's weird because the rates are sometimes very similar, but can be off by a lot as well. When I change the slicer to use the Month column the results match exactly.
Hi jgoddard,
Are the date continuous? You may try PREVIOUSYEAR instead if the date value is not continuous. If this issue persists, please share some sample data or share some screenshot of your raw data and do mask the sensitive data.
Regards,
Jimmy Tao
The dates are continuous, however not necessarily YTD. Some times we need to compare from Week 21, and sometimes from Week 16 to current.
It also does not sum properly when using the Date column (range is changed daily).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |