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 have created a metric to calculate the sales for last year.
Below is the formula:
LastYear_Sales = CALCULATE(SUM('Fact_Sales'[SALES_AMT]),SAMEPERIODLASTYEAR('Dim_Day'[Date]))
when I create a table with: Date from Dim_Day and LastYear_Sales, I get the following error:
Solved! Go to Solution.
Based on my test, this can be caused by an invalid datetime value that exceeds the year 9999.
Based on my test, this can be caused by an invalid datetime value that exceeds the year 9999.
Seems like it does not like your [Date] column. Is it flagged as a numeric field in the data model?
I checked that. It is a date/time field.
Hmm, reading the error more closely, it says MdxScript, is this a Live data source? (DirectQuery)
That function is not supported in DirectQuery mode.
I am using Import mode to fetch data from MySQL.
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.