Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
there are dates from 2017/1/1 to2018/9/6
when i create a table: table = datesinperiod ('sheet1'[date] , max('sheet1'[date]) , -1,year),the result is that it starts from 2017/10/1 to 2018/9/6,just 341days.
if i try : table = datesinperiod ('sheet1'[date] , date (2018,9,1), -1 ,year),the result is correct ,from 2017/9/2 to 2018/9/1
and other dates are also correct ,just the max(date) is wrong ,what is the problem?
thanks very much,guys.
Solved! Go to Solution.
i have used calendar to create the table.now i can use datesbetween('sheet'[date],edate(max('sheet'[date]),-12)+1,max('sheet'[date])) to avoid this problem. thank you.
I think you're probably getting into trouble here by not using a proper Dates table. DATESINPERIOD needs a contiguous dates table to work correctly. That's just an educated guess since I can't see your data.
--
If you want to create a dates table use CALENDAR function.
i have used calendar to create the table.now i can use datesbetween('sheet'[date],edate(max('sheet'[date]),-12)+1,max('sheet'[date])) to avoid this problem. thank you.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 135 | |
| 110 | |
| 50 | |
| 31 | |
| 29 |