Data Science

How to calculate Year-over-Year (YoY) growth using DAX Time Intelligence?

SU Asked by Susan Wilson · 20-06-2025
0 upvotes 9,243 views 0 comments
The question

I’m trying to compare this year's sales to last year's in a single bar chart. I’ve tried using the SAMEPERIODLASTYEAR function but I’m getting blank results. Do I need a specialized Date Table for these DAX functions to work correctly, or can I just use the default date column from my sales data?

3 answers

0
PA
Answered on 25-06-2025

You absolutely need a dedicated, marked "Date Table" for Time Intelligence to work reliably. The default "Auto Date/Time" feature in Power BI creates hidden tables that bloat your model and often fail in complex calculations. Create a proper Date table in Power Query or using DAX CALENDARAUTO(). Once you have a continuous range of dates with no gaps, your formula CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])) will work perfectly. This allows the filter context to shift back exactly one year while respecting any slicers on your report.

0
RI
Answered on 28-06-2025

If I have a fiscal year that starts in July instead of January, how can I adjust these standard DAX functions to reflect our specific corporate calendar?

JO 30-06-2025

For fiscal calendars, Richard, you can't always rely on the basic functions. You’ll need to use DATEADD or CALCULATE with specific filters. Most pros add a "FiscalYear" and "FiscalMonth" column to their Date table. Then you can use those columns to filter your measures. It takes a bit more setup, but it ensures your "Year-to-Date" (YTD) calculations align with your company's actual financial reporting periods.

0
DA
Answered on 02-07-2025

Always check your relationships. If your Date table isn't correctly linked to your Fact table's date column, all your time intelligence measures will return blank or incorrect values.

SU 03-07-2025

Good point, Daniel. Also, make sure both date columns are set to the "Date" data type, not "Date/Time," to avoid mismatch issues at the hour/minute level.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session