Forum Discussion
Interesting effects with calendar-based time intelligence
- 3 months ago
Hi SalvaC ,
when you expanding 2023, it changes the PY results of 2024. It is a bug in the new calendar-based DATEADD() implementation for custom weekly calendars in that specific semantic model. Instead of using calendar-based time intelligence, better to use Classic Time Intelligence. Please try below measure.
Online Sales PY Weekly-Dates =
CALCULATE(
[Sum Online Sales],
DATEADD('Week-Date Calendar'[Date], -1, YEAR)
)The new calendar-based TI behaves differently because it works from the tagged calendar and its current filter context.
If you are still experiencing the issue, as you mentioned, the new datamodel (ContosoRetail_Sale) is working fine, but the problem persists with the old datamodel (ContosoRetail_Small). Please update the Date hierarchy fields in the old datamodel to match those in the new datamodel. Refer to the screenshots above for guidance.
Hello SalvaC
if you can send me the pbix I can check the thing
Usually, with the new Time INtelligence, it is suggested to avoid using DATEADD to go back one year with the syntax you used and it is suggested to write a code like
CALCULATE([Online Sales]
,DATEADD('Weekly Calendar', -12, MONTH)
)
To avoid the side effects of the way the new Time Intelligence works with leap years
anyway I cannot say if this solves or not until I see your pbix
PS I suggest to create a new post on this issue to avoid losing the thread (please @me in it)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Best
F
Dear FBergamaschi
Sorry for the long delay.
You can find my Power BI files here: https://drive.google.com/drive/folders/1H5uJyXM3egzGdlTG5vb95f3i-_SdQoxH?usp=sharing
The ContosoRetail_Small.pbip contains the version with the issue.
You can find it on the page "Week Calendar Separated".
The ContosoRetail_Sales.pbip contains the working version on the page "Weekly"
I hope that you can find the issue or what I have overlooked, as it really unsettles me.
Kind regards
Salvatore