Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

DatesInPeriod() Broken

This function appears to be getting tripped up by the transition from February to March.

When I ask Dax: DATESINPERIOD('Calendar'[Dates], TODAY(), -1, YEAR) on today, February 1st, I get 338 days between today and March 1st 2018. My calendar table is the last two calendar years, and correctly has 397 days in it (365 from 2018 plus the 32 so far this year).

 

Please refer to:

https://community.powerbi.com/t5/Desktop/DatesInPeriod-Broken/m-p/613310#M292318

Status: New
Comments
Anonymous
Not applicable

@jengwt,

Please make sure that Calendar table covers the latest dates you want to display in  DATESINPERIOD function. There is a similar thread about DATEADD function which has similar workflow with DATESINPERIOD function.

Calendar= CALENDAR(DATE(2018,1,1),Date which is greater than today)


This way, DATESINPERIOD('Calendar'[Dates], TODAY(), -1, YEAR) will return correct result.

Reagrds,
Lydia