Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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).