I am trying to create MTD TY vs MTD LY and a similar calculation for YTD but i’m having contiguous error while using SamePeriodLastYear and tried few other time intelligence functions.
I’m using a view with a date column and joined that with the date table created using your query.
This honestly shouldn’t be too difficult but it’s hard to know exactly what the answer is without seeing the DAX formulas you’re using or a demo model of the scenario you are dealing with.
This should be straight forward though if you have the right model setup with a date table and then utilizing the correct time intelligence functions.
Potentially use DATEADD here instead of SAMEPERIODLASTYEAR. It’s a little more flexible.
I do believe though this will be a simple fix if you can provide more info.
This is simply your relationships not being correct here.
Can you send an image of the model your have?
You need to have a one to many relationship here from your date table to your fact table. All I can see is that you don’t currently have this setup correctly.
I have an active relationship defined. Please see the attached image! And also none of the DAX time functions works for me! DATEADD, PARALLEL PERIOD etc…
It looks like your field called accounting date does not have contiguous dates. Need to use your Date Query Date field. Your measure for MTD LY should look something like: