Forum Discussion

JimJim's avatar
JimJim
Responsive Resident
2 years ago
Solved

Issue with DATESINPERIOD

Hi Guys, Firstly, I am sorry for the lack of test data or even a pbix file, I tried replicating the issue in a test report so that I could demonstrate it to you, but I can't replicate the issue.   ...
  • Ahmedx's avatar
    2 years ago

    replace this piece of code with the following

    VAR __dates = 
            DATESINPERIOD('Time (previous months)'[CalendarDate],
            __selectedDate,
            -13,
            MONTH)

    to

    VAR __dates = 
            DATESBETWEEN('Time (previous months)'[CalendarDate]
            ,EDATE(__selectedDate,-13),__selectedDate)