Power BI Guide · Updated July 2026 · 8 min read · Flexa Intel Team

SAMEPERIODLASTYEAR in Power BI: Limitations & Alternatives

If you've built more than a handful of Power BI reports, you've reached for SAMEPERIODLASTYEAR — and at some point stared at a blank cell wondering why it stopped working the moment you added it to a measure. You're not doing anything wrong. The cases where it quietly fails are rarely covered in the intro tutorials.

4
common failure modes
3
built-in DAX alternatives
Sep 2025
calendar-based fix shipped
Quick Answer

SAMEPERIODLASTYEAR shifts filter-context dates back exactly one year to build YoY comparisons, but it only handles the simplest case. It breaks when you need a non-yearly shift, a gap-free calendar table, a fiscal or retail calendar, or when the current period is still incomplete. Each of those four situations has a specific DAX fix — DATEADD, a manual filter pattern, or the new calendar-based time intelligence feature. If you need YoY, MoM, or budget-vs-actuals variance without touching any of this DAX, see our guide to variance analysis in Power BI.

In short:

Need a comparison interval other than one year (month, quarter) — use DATEADD
Date table isn't contiguous — build a proper Calendar table, or filter manually
Using a fiscal or retail calendar, not standard Gregorian — try Calendar-based Time Intelligence (new, preview)
An incomplete current period causes "phantom" prior-year data on charts — wrap with an ISBLANK check
01

How SAMEPERIODLASTYEAR actually works

SAMEPERIODLASTYEAR takes the dates currently in filter context and shifts every one of them back exactly one year, then lets CALCULATE re-evaluate your measure against that shifted set of dates.

DAXRevenue LY
Revenue LY =
CALCULATE (
    [Total Revenue],
    SAMEPERIODLASTYEAR ( 'Calendar'[Date] )
)

That's why it's context-sensitive: at the year level it returns last year's total, at the month level the same month last year, at the day level the same calendar day last year — as long as your model matches the assumptions it was built on.

THIS YEAR (FILTER CONTEXT)Jan 2026 – Dec 2026SAMEPERIODLASTYEAR RETURNSJan 2025 – Dec 2025 (shifted −1 year)
SAMEPERIODLASTYEAR shifts the entire current date filter back one year, then re-evaluates the measure against those shifted dates.
Tip

Before troubleshooting the DAX itself, confirm your date column is actually marked as a Date table (Model view → column → "Mark as date table"). Most SAMEPERIODLASTYEAR issues trace back to this being skipped.

02

Four situations where it falls short

2.1It only shifts by exactly one year

There's no parameter for "one quarter back" or "one month back." If your dashboard needs MoM or QoQ comparisons alongside YoY, you're forced into a different function for each — usually meaning several time-intelligence patterns living in the same model. See our dedicated guides on MoM comparisons and YoY comparisons without DAX if that's your immediate need.

2.2It requires a proper, continuous date table

This is the one that trips up the most people. SAMEPERIODLASTYEAR isn't designed to run directly against a transaction table — it needs a dedicated calendar table where the date column is contiguous (no gaps) and unique (no duplicates).

✓ A DEDICATED CALENDAR TABLE — EVERY DAY PRESENT
Mon 6
Tue 7
Wed 8
Thu 9
Fri 10
Sat 11
✕ FILTERING A TRANSACTION TABLE DIRECTLY — ROWS MISSING ON NO-SALE DAYS
Mon 6
missing
Wed 8
missing
missing
Sat 11
"Missing" = no row exists for that date because there were no transactions that day — the date-shift logic can't find it, so results come back blank or wrong.
A dedicated calendar table has every date. A transaction table only has rows for days something actually happened.

2.3It only understands the Gregorian calendar

Fiscal years that don't start in January, 4-4-5 or 4-5-4 retail calendars, ISO weeks — none of these are native to SAMEPERIODLASTYEAR. Until recently, the only fix was a custom fiscal calendar table with manual FILTER / EDATE logic on top — messy, and easy to get subtly wrong.

2.4It creates "phantom" data for incomplete periods

Mid-month, when this year's measure is still blank for the rest of the month, SAMEPERIODLASTYEAR happily returns last year's full-month value anyway — so the "this year" line on a chart stops early while the "last year" line keeps going, reading like a sudden drop.

THIS YEAR — STOPS HERE (NO DATA YET)
TODAY
LAST YEAR — KEEPS GOING
This year — stops (no data yet)Last year — keeps goingToday's date
Without a blank-check, an unfinished current period makes the prior-year line look like it's pulling ahead — a false signal.

The fix is a check that returns blank whenever the current period has no data yet:

DAXRevenue LY (safe)
Revenue LY (safe) =
IF (
    ISBLANK ( [Total Revenue] ),
    BLANK (),
    CALCULATE ( [Total Revenue], SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
)

In practice: this ISBLANK wrapper is exactly the kind of edge case that gets skipped under deadline pressure. Flexa Tables applies it automatically to every ΔVar column, so an in-progress period doesn't silently plot last year's full total against this year's partial one.

03

Which function should you use instead

Each limitation above maps to a specific fix:

DATEADD
Need a period other than exactly one year back (last month, last quarter)
Accepts an interval parameter (DAY, MONTH, QUARTER, YEAR) — one function covers every shift you need
PARALLELPERIOD
Need the comparison to always span a whole period, no matter how many days it contains
Returns the entire prior period (e.g. all of last February) rather than a day-for-day shift
FILTER + EDATE
Calendar table isn't continuous, or you're stuck filtering a transaction table directly
Manual pattern that doesn't depend on the structural assumptions classic functions require
Calendar-based
Need fiscal year, retail 4-4-5/4-5-4, ISO, or week-based comparisons
Purpose-built for non-Gregorian calendars — see next section

SAMEPERIODLASTYEAR vs. DATEADD vs. PARALLELPERIOD, side by side

FunctionShifts byReturnsBest for
SAMEPERIODLASTYEARExactly 1 year, fixedSame dates, shifted back one yearSimple YoY only
DATEADDAny interval (day, month, quarter, year)Dates shifted by N intervals, day-for-dayMoM, QoQ, or any custom shift
PARALLELPERIODAny interval (day, month, quarter, year)The entire prior period, not day-matchedComparing whole months/quarters regardless of day count

Worth noting: if you're mainly weighing these three functions to build one variance column, Flexa Tables' field panel picks the right comparison logic based on what you select — you don't have to make this DATEADD-vs-PARALLELPERIOD call yourself.

04

A newer option for fiscal calendars

In the September 2025 release, Power BI Desktop introduced Enhanced DAX Time Intelligence — still in public preview — which targets the Gregorian-only gap directly. Instead of assuming a standard January–December calendar, you explicitly define a "calendar" on your date table by mapping its columns to categories like year, quarter, month, week, and date. That calendar can then be referenced inside familiar functions, including SAMEPERIODLASTYEAR and TOTALYTD.

Works with Gregorian, shifted Gregorian, retail (445/454/544), 13-month, and other non-standard calendars
Continuous date tables are still recommended, but sparse date tables are now supported
Adds new week-based functions, like TOTALWTD, that classic time intelligence never had
Needs at least the September 2025 build of Power BI Desktop, enabled under Options → Preview features
!
Worth knowing

It's still a preview feature with its own setup checklist — a custom calendar to define, a build requirement, a manual toggle. Useful, but not exactly a five-minute fix, and it still doesn't touch the other three limitations above.

✦ What we noticed building Flexa Tables
05

A simpler path for everyday variance charts

Everything above is a lot of DAX just to answer one question: how does this period compare to the same period before? Fair enough — most of the time, that's not something worth hand-rolling from scratch.

It's why variance analysis comparisons are a built-in setting in Flexa Tables, rather than something you wire up with measures. You pick the base period and the comparison period from a field list, choose what to calculate — variance, variance %, or ratio — and the visual handles the rest, including the blank-period edge case from section 2.4.

Year-over-Year Total Revenue Variance by Product Category
Category20242025ΔVar
Bike Racks$22.7K$36.2K-$13.5K
Bottles & Cages$67.4K$107.7K-$40.3K
Helmets$131.0K$205.8K-$74.8K
Jerseys$0$45.0K+$45.0K
Total$569.8K$906.7K-$408.0K
Compared by
Year
Select calculations
ΔVar
ΔVar%
Ratio
Illustrative recreation of the Flexa Tables variance panel — pick the compared field and calculation type, no measures required.
Writing it in DAX
Choose DATEADD vs. PARALLELPERIOD, verify a contiguous calendar table, add a blank-check, repeat per variance type
In Flexa Tables
Pick base year, comparison year, and calculation type from the panel — done

It's not a replacement for understanding time intelligence — the concepts above still matter for anything custom. But for the everyday case of putting a YoY, MoM, or DoD column next to your numbers, it saves you from re-deriving all of section 2 every time. Flexa Tables works as a drop-in Power BI pivot table replacement, so this comes built into the same visual you're likely already using.

Add variance columns without writing DAX

Flexa Tables is a Microsoft-certified Power BI visual — pick your comparison, get YoY, MoM, or budget-vs-actuals variance instantly, right in the Service.

Get Flexa Tables on AppSource →
06

Frequently asked

Why does my SAMEPERIODLASTYEAR measure return blank?

Usually the measure is filtered against a transaction table instead of a proper calendar table, the date table has gaps or duplicate dates, or the date column isn't marked as a Date table in the model.

What's the difference between SAMEPERIODLASTYEAR and DATEADD?

SAMEPERIODLASTYEAR always shifts exactly one year back. DATEADD takes an interval parameter (day, month, quarter, year), so it covers any period-over-period comparison, not just YoY.

Can SAMEPERIODLASTYEAR be used with a fiscal year calendar?

Not natively — it assumes standard Gregorian. For fiscal or retail calendars, either build a custom fiscal date table with manual DAX, or use Power BI's calendar-based time intelligence (preview, September 2025 onward).

Does SAMEPERIODLASTYEAR require a Date table?

Yes — a contiguous, unique date column, ideally marked as a Date table in the model settings.

Is SAMEPERIODLASTYEAR being deprecated in favor of calendar-based time intelligence?

No. Calendar-based time intelligence extends the same functions rather than replacing them — SAMEPERIODLASTYEAR still works exactly as before for standard Gregorian calendars. It's an additive preview feature, not a breaking change.

FI
Written by the Flexa Intel Team

We build Power BI tooling — including Flexa Tables — and write about the DAX and modeling problems we run into along the way. See more in our Power BI financial reporting guide, or browse the blog.

facebooklinkedintwittermail