Forum Discussion
Anonymous
3 years agoNot applicable
Why Datesinperiod returns future date
Hello everyone,
I have a question. When I use the Datesinperiod function, it always returns the future dates, is there any way to eliminate them?
Here is my code
CAPAs Opened MTD Measure = CALCULATE(COUNT('CAPAs Opened MTD'[CAPA PR ID]),
DATESINPERIOD('Date Table'[Date],LASTDATE('Date Table'[Date]), -1, MONTH))
Thanks for helping me
You could try DATESBETWEEN('Date'[Date], MAX('Fact table'[Date]), TODAY())
3 Replies
- johnt75
Super User
A properly formed date table will have dates until 31 December in the final year, which could be why you're getting dates in the future. If you want to restrict it to 1 month from today you could use DATESINPERIOD('Date'[Date], TODAY(), -1, MONTH)