Power BI How-To / Advanced Modeling

Power BI Slowly Changing Dimension Design: Building Type 2 History Upstream

A power bi slowly changing dimension only keeps history if that history is built before the data reaches Power BI. Refresh overwrites dimension rows, so Type 2 versioning has to live in a warehouse or the source system. This article covers that one advanced pattern: where to build Type 2, how surrogate keys route facts to the right version, as-was versus as-is reporting, and what breaks. For general fact-and-dimension modeling, start with our Power BI star schema guide.

What is a slowly changing dimension?

A slowly changing dimension is a dimension table whose attributes change occasionally: a customer moves region, a product changes category, an employee changes department. The design question is whether reports should see only the latest value, overwriting the old one, or keep each prior version so historical facts stay attached to the attribute they had at the time. A change of manager is a common case, and because a manager column makes the employee table point at itself, our guide to flattening a Power BI parent child hierarchy covers turning that reporting line into drillable levels.

The classic example is a salesperson who moves from one sales region to another. If the dimension simply updates the region, every sale that person ever made now rolls up to the new region, and last year’s regional totals change after the fact. That is sometimes what the business wants and sometimes a serious reporting error. Microsoft’s star schema guidance on slowly changing dimensions (opens in new tab) uses exactly this salesperson case, and it describes two common approaches: Type 1 and Type 2.

What is the difference between Type 1 and Type 2?

Type 1 overwrites: when an attribute changes, the dimension row is updated and every historical fact now reports under the new value. Type 2 versions: the current row is expired with an end date and a new row is inserted with its own surrogate key, so older facts keep pointing at the version that was true when they happened.

Slowly changing dimension types compared, and what each one means for a Power BI model.
Characteristic Type 1 (overwrite) Type 2 (new version) Type 3 (previous-value column)
What happens on a change The existing row is updated in place The current row is expired and a new row is inserted The row is updated and the old value moves to a “previous” column
History kept None — it is as if the new value was always true Full, one row per version with start and end dates Limited — usually just the prior value
Rows per business entity One One per version One
Key the facts relate on Business key or surrogate key Surrogate key (the business key repeats) Business key or surrogate key
Typical attributes Email, phone, spelling corrections Sales territory, cost center, customer segment, job grade A one-off reorganization where only old vs new matters
Can Power BI produce it alone? Yes — a normal full refresh is Type 1 No — it must be loaded pre-built Only if the source already stores the prior value

One dimension table can mix types: track region as Type 2 and phone number as Type 1 on the same customer row. Microsoft’s Fabric guidance also notes that Type 3 is uncommon and awkward to use in a semantic model, so most Power BI projects come down to a choice between Type 1 and Type 2 for each column.

Why can’t Power BI build Type 2 history on its own?

Because a refresh replaces the dimension table with the source’s current rows. Power Query keeps no memory of the previous load, so it cannot detect that a value changed, expire the old row, or insert a new version. Microsoft Learn states that a semantic model can’t produce this result; it can only load a pre-built Type 2 table.

The same Learn article spells out the mechanics: when the source doesn’t store versions, an intermediate system such as a data warehouse must preserve existing rows, detect changes, set the end date on the expiring version, insert the new one, and give related facts a time-based lookup to the right dimension key. None of those steps fits a query that starts from scratch on every refresh.

A common workaround is to switch on incremental refresh for the dimension in the hope that old partitions will “freeze” history. It doesn’t do that job. Incremental refresh partitions a table by a date column and reloads recent partitions; it is designed for large, append-style fact tables, as our incremental refresh setup guide explains. It doesn’t compare attribute values, assign surrogate keys, or set end dates, and a republish or full refresh can rebuild every partition from the source’s current state.

Where should you build the Type 2 table?

Upstream, in a layer that persists data between loads: a SQL data warehouse, a Microsoft Fabric warehouse or lakehouse, or the source system itself if it already keeps effective-dated records. Power BI then imports the finished dimension like any other table, and every report built on the model reads the same versioned history.

Where Type 2 history can be built for a Power BI model, and the trade-offs of each option.
Where it’s built How changes are detected Good fit when Watch out for
SQL Server or Azure SQL data warehouse A scheduled stored procedure compares staged source rows with current versions, then updates and inserts You already run a SQL warehouse and an ETL schedule The job must run before the Power BI refresh, and compare logic must handle nulls
Microsoft Fabric warehouse or lakehouse T-SQL in a Fabric warehouse, or a pipeline or notebook step in a lakehouse You are starting fresh on Fabric or moving off file-based sources Orchestration: the pipeline and the semantic model refresh need a defined order
Source system with effective-dated records The source already stores each change with valid-from and valid-to dates HR, payroll and pricing systems that keep effective dates Gaps or overlaps in the date ranges, and you still need a surrogate key per version
Power Query only None — each refresh sees only today’s values Type 1 attributes It silently behaves as Type 1, so history appears to rewrite itself

Microsoft’s Fabric documentation walks through the update-then-insert pattern and the tracking columns (valid-from, valid-to, a current flag, an optional change reason) in its section on managing historical change in dimension tables (opens in new tab). If the warehouse layer doesn’t exist yet, that is the real project. Our Microsoft Fabric consulting covers building it.

How do surrogate keys connect facts to the right version?

Each Type 2 row gets a surrogate key, an integer unique per version, because the business key such as customer ID repeats across versions. During the fact load, each fact row looks up the version whose StartDate and EndDate bracket the fact’s date and stores that surrogate key. The model then relates fact to dimension on the surrogate key, one-to-many.

That lookup is the step people miss. A Type 2 dimension is only half the pattern: if the fact table still carries just the business key, Power BI has no way to know which version a sale belongs to. Relating on the business key instead produces a many-to-many relationship, because the key is no longer unique on the dimension side. In practice the dimension carries these columns:

  • Surrogate key (for example CustomerKey): one value per version; the “one” side of the relationship. Hide it from report authors.
  • Business key (for example CustomerID): the source identifier, repeated on every version of the same customer.
  • StartDate and EndDate: the period each version was valid, with no gaps and no overlaps for a given business key.
  • IsCurrent: a flag marking the latest version, so “current rows only” filters don’t need date logic.
  • Version label: a readable description such as the name plus region, so users can tell versions apart in a slicer.

Facts that arrive late, such as a back-dated adjustment, must go through the same date-range lookup using the fact’s own date, not the load date. Otherwise they attach to the current version and quietly move history.

How do you report as-was versus as-is?

As-was reporting shows each fact under the attribute it had when it happened, and it comes for free once facts relate on the surrogate key. As-is reporting restates all history under today’s attribute, so the dimension also needs current-value columns copied onto every version, or a separate current-only dimension joined on the business key.

Most finance and sales teams need both. A regional manager reviewing last year wants as-was (credit stays where it was earned), while a manager planning next year wants as-is (how does the current territory map look over time). The practical approach is to carry both columns side by side: Region for as-was and Current Region for as-is, with the current value refreshed onto every historical version during the upstream load. Microsoft’s guidance also recommends a column for the member and a separate, unambiguous column for the version, with a hierarchy that drills from one to the other.

Two DAX habits keep the numbers honest. Count entities with DISTINCTCOUNT on the business key, not the surrogate key, or a customer with three versions is counted three times. And when a visual should show only current members, filter on IsCurrent rather than comparing dates. If your measures already lean on complex filter logic, our data modeling and DAX service can review them against the versioned dimension.

What breaks when a Type 2 dimension is built wrong?

Most failures show up as totals that are slightly off rather than as errors. Overlapping date ranges send one fact to two versions or none, counting surrogate keys inflates customer counts, joining on the business key creates a many-to-many relationship, and late-arriving facts get stamped with the current version instead of the historical one.

  • Duplicate names in slicers: users see the same customer several times. Expose the business-key-level name for selection and keep the version label for drill-down.
  • Inflated counts: a measure counts rows or surrogate keys in the dimension. Count the business key instead.
  • Facts falling into the blank row: the fact’s date sits in a gap between versions, or before the first StartDate. Make the first version start early enough to cover all history, and test for gaps after every load.
  • Double-counted facts: two versions overlap on the same date, so the lookup matches both. Enforce that each EndDate meets the next StartDate exactly, with one side of the boundary inclusive.
  • History that rewrites itself: someone rebuilt the dimension from the source’s current state, collapsing all versions. Protect the history table from full reloads.
  • Version explosion: every column is tracked as Type 2, so trivial edits create new rows. Track only columns where history changes a decision; Microsoft’s guidance suggests a frequently changing attribute may belong in the fact table instead.

Getting help with a Type 2 dimension

Adding Type 2 history to one dimension on an existing SQL warehouse is usually a well-bounded task. Standing up the warehouse layer first, or fixing a model whose history has already been overwritten, takes longer. Easy Power BI Dashboards works from prepaid Flex hours, from $100/hour, with blocks of Starter at $2,500, Growth at $4,600 and Power at $8,000, and the hours never expire. You describe the dimension and the reports that depend on it, we come back with a scope and an hour estimate, and work starts only after you approve it. Details are on how it works and pricing.

FAQ

Frequently asked questions

No. Type 2 adds rows, surrogate keys, an upstream load process and reporting rules your users must understand. Use it only for attributes where historical accuracy changes a decision, such as sales territory, cost center or customer segment. Contact details and spelling fixes belong in Type 1, and one table can mix both.

Not a true one. DAX calculated tables are recomputed from the current model data at every refresh, so they can’t remember a value that the source has overwritten. DAX is useful on top of a finished Type 2 table, such as measures that count business keys or filter to current rows, but the history must be stored upstream.

Pick one convention and use it everywhere. A blank end date is accurate, but every between-date lookup then needs extra null handling; a far-future sentinel date keeps the comparison simple. Microsoft’s guidance shows both. Pair it with an IsCurrent flag so report filters for current rows don’t depend on date arithmetic at all.

Rarely in a way users notice. Versioning adds one dimension row per tracked change, and dimensions are small next to fact tables. The bigger cost is upstream: load time and the date-range lookup during the fact load. Track only the few columns that matter, and hide the surrogate key from report authors.

Try us risk-free for 4 hours

If you’re unhappy within the first 4 hours of your block, we’ll refund you in full — no questions asked. Hours are deducted only for work you’ve reviewed and approved, and they never expire.

Last year’s numbers keep changing?

That is usually a dimension being overwritten on every refresh. Bring the model to a free demo and we’ll show you where the history is being lost and what it takes to keep it.

Scope approved before any hours are used · Hours never expire

Book a free demo

See what your Power BI reporting would take

Tell us the task. We reply within one business day, and you get a scope estimate and the hours needed before any work begins.

Step 1 of 2: What do you need?

How can we help? Pick one

Tap to add, or type your own:

Step 2 of 2: Where should we reply?

Used only to contact you about this inquiry.

We reply within one business day. Scope approved before any hours are used. We don’t sell your information.

Tell us the task. We scope it, you approve, and a senior consultant delivers — typically in 3–5 business days. Prepaid hours that never expire.

  • Prepaid hours from $100/hour — and they never expire
  • Senior-led delivery — 20+ years on the Microsoft platform
  • Typical 3–5 business day turnaround
  • Full refund if you’re unhappy in your first 4 hours
Book my free demo