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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
i am guessing the day 29-29=0, then can't create a date with the day is 0.
if changed to 2020-09-30, then it works.
what's the expected output that you want?
Proud to be a Super User!
maybe you can try this
Last_30_Days =
VAR MaxDate = "2020-09-29"
Return FORMAT((MaxDate-29),"yyyy-mm-dd")
Proud to be a Super User!
@ryan_mayu, Already tried and implemented in same way Thanks!! , My only point to bring this up is what's wrong with Date function to calculate Date on mentioned DAX.
As what I mentioned, you can't transfer value 0 to day parameter in the date function. please check the official doc.
https://docs.microsoft.com/en-us/dax/date-function-dax
Proud to be a Super User!
@Mohd_Naim , I checked out. it only do not support 0. I able to subtract 31
@Mohd_Naim , Hey, I obsereved it is not working beacause your day which is 29 and the number you are substracting are same.
For your refernce I increased a day here and it is working. Check the below screenshot which you are using is not working as they are same.
By this we can understand that we have substract either higher number are lesser number than our day.
If you think this is helpful Accept the Solution and leave a like.
Regards,
Manikumar
Proud to be a Super User!
@Mohd_Naim , Try like
Last_30_Days =
VAR MaxDate = date(2020,09,29)
Return Date(YEAR(MaxDate),MONTH(MaxDate),DAY(MaxDate)-29)
Use date function to create date
Hi,
This is the actual DAX which is failing for 29 date, Can you please check by running DAX by changing dates,
Last_30_Days =
VAR MaxDate = MAX(Dimdate[Date])
Return Date(YEAR(MaxDate),MONTH(MaxDate),DAY(MaxDate)-29)
Thanks,
Getting same error even with your solution.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.