Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
My date table contains 1/1/2017 through 1/16/2020
When I execute this:
Table = DATESINPERIOD ( 'Date'[Date], MAX('Date'[Date]), -1, YEAR )
My first date in the table is 2/1/2019. I would expect 1/17/2019. When I use -365, DAYS instead of -1, YEAR it works as expected.
However, when I use:
Table = DATESINPERIOD ( 'Date'[Date], MAX('Date'[Date])-1, -1, YEAR )
The first date is 1/16/2019 as I would expect.
Any idea why this is happening and what I can do to correct?
Solved! Go to Solution.
Hi @n8ball
it is difficult to describe but it is logical
for datesbetween the start day (day+month in your case) of returned table could not be equal max day (day+max)
-1 year means that returned dataset will start from 1 year exactly +1 day
try to read this article https://radacad.com/datesinperiod-vs-datesbetween-dax-time-intelligence-for-power-bi to understand more
Hi @n8ball
it is difficult to describe but it is logical
for datesbetween the start day (day+month in your case) of returned table could not be equal max day (day+max)
-1 year means that returned dataset will start from 1 year exactly +1 day
try to read this article https://radacad.com/datesinperiod-vs-datesbetween-dax-time-intelligence-for-power-bi to understand more
Thanks I thougth something like that was happening but I couldn't find any confirmation. Time intelegence functions get funky at the ends of the date table. Do people normally just make date tables largerger than needed? Or do they use differnt DAX to achieve the result I'm looking for?
usually to create calendar table CALENDAR() and CALENDARAUTO() function are used.
functions like datesinperiod() or datesbetween() are being used for filtering inside calculation. and from this point of view it has a lot of sence to avoid some duplicate. usually if you try to calculate smth for last rolling year, your calculated period will not start from the same day that end day, in common case it will be next day
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |