Power BI Veri Modelleme: Star Schema Nedir?

Fact ve dimension tablolarından ilişkilere, filtre yönünden rapor performansına kadar Power BI'da star schema yaklaşımını bir satış modeli üzerinden inceliyorum.

  • Araçlar
  • Veri Görselleştirme

İyi bir Power BI raporu yalnızca doğru grafiklerden oluşmaz. Verinin nasıl organize edildiği, tabloların nasıl ilişkilendirildiği ve filtrelerin model içinde nasıl aktığı da raporun doğruluğunu, performansını ve sürdürülebilirliğini belirler.

Bu yazıda star schema yaklaşımını; fact ve dimension tablolarını, ilişkileri, filtre yönünü ve bütün bunların rapor performansına etkisini bir satış modeli üzerinden ele alıyorum.

“Güzel görünen bir dashboard kullanıcıyı ilk anda etkiler; iyi tasarlanmış bir veri modeli ise raporun arkasındaki bütün karar sürecini sağlamlaştırır.”

1. Power BI'da Veri Modelleme Nedir?

Veri modelleme; farklı kaynaklardan gelen tabloların raporda anlamlı ve doğru şekilde kullanılabilmesi için belirli bir mantıkla düzenlenmesi ve birbirleriyle ilişkilendirilmesidir. Power BI'da model, tabloların yan yana durduğu bir alan değil; boyutların filtreleme mantığını ve ölçülerin hangi bağlamda hesaplanacağını belirleyen raporun omurgasıdır.

01

Doğruluk

İlişkiler doğru kurulursa toplamlar, kırılımlar ve DAX ölçüleri daha güvenilir sonuç verir.

02

Performans

Daha sade ve öngörülebilir bir model, sorguların gereksiz hesaplama yapmasını azaltır.

03

Sürdürülebilirlik

Yeni ölçü ve rapor sayfaları eklenirken modelin mantığını anlamak ve yönetmek kolaylaşır.

Modelden rapora
  1. Veriyi
    Anla
  2. Modeli
    Tasarla
  3. İlişkileri
    Kur
  4. DAX ile
    Analiz Et
  5. Görselleştir

2. Star Schema Nedir?

Star schema (yıldız şema), merkezde bir veya daha fazla fact table'ın, çevresinde ise onu tanımlayan dimension table'ların bulunduğu veri modelleme yaklaşımıdır. Görsel olarak bir yıldızı andırdığı için bu isimle anılıyor.

Temel fikir: Sayısal ve olay bazlı veriyi merkezde tut; tarihi, ürünü, müşteriyi, mağazayı veya bölgeyi açıklayan bilgileri çevredeki boyut tablolarında yönet.

Buradaki önemli nokta, dimension tablolarının genellikle filtreleme ve gruplama amacıyla, fact tablosunun ise ölçümlerin hesaplanması için kullanılması.

3. Fact ve Dimension Tabloları Arasındaki Fark

ÖzellikFact tableDimension table
AmaçOlayları ve ölçülebilir değerleri saklamakOlayları açıklamak ve filtrelemek
ÖrnekFactSalesDimProduct, DimCustomer, DimDate
Veri tipiAdet, ciro, maliyet gibi ölçümler + anahtarlarÜrün, kategori, müşteri, şehir gibi açıklayıcı alanlar
Kayıt sayısıGenellikle yüksekGenellikle daha düşük
KullanımSUM, AVERAGE, COUNT gibi hesaplamaların temeliFiltreleme, gruplama ve detaya inme

Örnek FactSales tablosu

SalesIDDateKeyProductKeyCustomerKeyStoreKeyQuantitySalesAmount
10012026100112301421.800 ₺
1002202610011830421950 ₺
10032026100212309432.700 ₺

Fact tablosundaki DateKey, ProductKey, CustomerKey ve StoreKey alanları, çevredeki dimension tablolarına bağlanan anahtarlar.

4. Tablolar Arasındaki İlişkiler Nasıl Kurulur?

Star schema'da en yaygın ilişki tipi bire-çok (1:*) ilişkisi. Örneğin bir ürün dimension tablosunda bir kez bulunurken, o ürün FactSales tablosunda yüzlerce veya binlerce satış satırına karşılık gelebilir.

Model ilişkileri
DimDate[DateKey]          1 ──→ * FactSales[DateKey]
DimProduct[ProductKey]    1 ──→ * FactSales[ProductKey]
DimCustomer[CustomerKey]  1 ──→ * FactSales[CustomerKey]
DimStore[StoreKey]        1 ──→ * FactSales[StoreKey]

Tek bir ürün birçok satış kaydında yer alabilir. Filtre DimProduct'tan FactSales'a doğru aktığında, seçilen kategori veya ürün satış ölçülerini otomatik olarak etkiler.

Yön

Filtre yönü

Basit yıldız şemalarında dimension → fact yönü çoğu senaryo için daha kontrollü bir tasarım sağlar.

Anahtar

Teknik anahtar

Kurumsal modellerde dimension kayıtlarını stabil bir anahtarla eşlemek yönetimi kolaylaştırır.

Önemli: Çift yönlü ilişkileri yalnızca gerektiğinde kullan. Gereksiz çift yönlü filtreler beklenmeyen sonuçlara ve karmaşık model davranışlarına yol açabilir.

5. Basit Bir Satış Veri Modeli

Bir perakende şirketinin günlük satışlarını analiz ettiğimizi düşünelim. Elimizde satış hareketleri, ürünler, müşteriler, mağazalar ve takvim bilgileri bulunuyor.

Boyut

DimDate

DateKey, Date, Year, Quarter, Month, MonthName, Week, DayName

Boyut

DimProduct

ProductKey, ProductName, Category, Brand, UnitPrice

Boyut

DimCustomer

CustomerKey, CustomerName, Segment, City, Region

Boyut

DimStore

StoreKey, StoreName, City, Region, StoreType

Fact

FactSales

SalesID, DateKey, ProductKey, CustomerKey, StoreKey, Quantity, SalesAmount, CostAmount

Böyle bir yapı sayesinde “İstanbul'daki elektronik ürün satışları 2026'nın hangi ayında arttı?” sorusu tek bir model üzerinden analiz edilebilir. Kullanıcı DimStore'dan şehir, DimProduct'tan kategori, DimDate'ten yıl ve ay seçtiğinde FactSales üzerindeki ölçüler buna göre filtrelenir.

Basit DAX ölçüleri

Temel ölçü seti
Toplam Satis =
SUM(FactSales[SalesAmount])

Toplam Adet =
SUM(FactSales[Quantity])

Toplam Maliyet =
SUM(FactSales[CostAmount])

Brut Kar =
[Toplam Satis] - [Toplam Maliyet]

Kar Marji =
DIVIDE([Brut Kar], [Toplam Satis])

6. Power BI'da Star Schema Nasıl Kurulur?

Power BI'da modelleme genellikle Power Query'de verinin hazırlanmasıyla başlar, ardından model görünümünde tabloların ilişkileri oluşturulur. İyi sonuç almak için rapora gelmeden önce gereksiz kolonları ve kullanılmayacak verileri mümkün olduğunca azaltmak gerekiyor.

1. Adım

Veriyi temizle

Kaynak tabloları Power Query'de temizle ve biçimlendir.

2. Adım

Tabloları ayır

Fact ve dimension tablolarını birbirinden net biçimde ayır.

3. Adım

Anahtar oluştur

Boyut tablolarında benzersiz anahtarlar tanımla.

4. Adım

İlişkileri kur

İlişkileri mümkün olduğunca 1:* mantığında tasarla.

5. Adım

Tarih tablosu ekle

Takvimi ayrı bir dimension olarak oluştur.

6. Adım

İş mantığını ölçülere taşı

Hesaplamaları mümkün olduğunca measure'larda topla.

7. Veri Modelinin Rapor Performansına Etkisi

Power BI'da performans yalnızca donanım veya görsel sayısıyla ilgili değil. Modelin yapısı, veri hacmi, kolonların kardinalitesi, ilişkiler ve yazılan DAX sorguları birlikte sonucu etkiliyor.

Sadelik

Model sadeleşir

Tekrarlı alanları dimension ve fact sınırları içinde düzenlemek modeli anlaşılır kılar.

Filtre

Filtreleme netleşir

Dimension → fact akışı, kullanıcı seçimlerinin hangi ölçüyü etkileyeceğini öngörülebilir yapar.

DAX

Ölçüler okunur olur

Ölçüler fact tablosundaki sayısal alanlara odaklanır; boyutlar analiz bağlamını sağlar.

Ürün, müşteri, şehir ve kategori gibi bilgileri dev bir satış tablosunda sürekli tekrar etmek yerine dimension tablolarında tutmak modeli daha mantıklı bir yapıya taşıyor. Özellikle veri hacmi büyüdükçe sadelik ve tutarlılık belirleyici hale geliyor.

Pratik bakış: Bir raporda “neden bu toplam yanlış geldi?” veya “bu filtre neden başka bir görseli de etkiliyor?” soruları sık yaşanıyorsa, yalnızca DAX formülünü değil veri modelini de kontrol etmek gerekir.

8. Sık Yapılan Veri Modelleme Hataları

HataNeden sorun?Daha iyi yaklaşım
Tek tabloyla her şeyi çözmeye çalışmakTekrarlı alanlar, karmaşıklık ve yönetim zorluğuUygun fact / dimension ayrımı
Çok fazla çoka-çok ilişkiFiltre akışı ve ölçülerin davranışı karmaşıklaşırGerekirse ara (bridge) tablo kullanmak
Gereksiz çift yönlü filtrelemeBeklenmeyen filtre yayılımıMümkün olduğunca kontrollü tek yön
Tarih tablosu kullanmamakZaman analizleri ve DAX tarih hesapları zorlaşırStandart bir DimDate oluşturmak
Gereksiz kolonları modele almakModel boyutu ve sorgu maliyeti artarYalnızca gerekli alanları tutmak

9. İyi Bir Power BI Modeli İçin Kontrol Listesi

Fact

Fact tablosu

Tek bir iş olayını temsil ediyor mu? Satırın neyi temsil ettiği net mi? Ölçülebilir alanlar doğru mu?

Boyut

Dimension tabloları

Filtre ve kırılım alanları anlaşılır mı? Anahtarlar benzersiz mi? Gereksiz tekrar var mı?

İlişki

İlişkiler

Kardinalite doğru mu? Filtre yönü beklenen gibi mi? Gereksiz karmaşık bağlantı var mı?

Performans

Rapor performansı

Model gereksiz alanlardan arındırıldı mı? Ölçüler doğru bağlamda çalışıyor mu? Yavaş görsellerin kaynağı incelendi mi?

Sonuç: İyi Raporun Temeli İyi Modeldir

Power BI'da etkili raporlama yalnızca grafik seçmekten ibaret değil. Raporun arkasındaki veri modelinin doğru kurulması; ölçülerin güvenilir çalışmasını, filtrelerin tahmin edilebilir davranmasını, yeni analizlerin kolay eklenmesini ve modelin uzun vadede rahat yönetilmesini sağlıyor.

Star schema yaklaşımında fact table ölçülebilir olayları merkezde tutar; dimension table'lar ise bu olayları tarih, ürün, müşteri ve mağaza gibi boyutlarla açıklar. Doğru ilişkiler ve sade bir model, raporun hem analitik kalitesini hem de kullanım deneyimini güçlendirir.

“Veri modelleme, rapor tasarımından önce gelmesi gereken temel becerilerden biridir.”

A good Power BI report is not made of the right charts alone. How the data is organised, how the tables relate to each other and how filters flow through the model all shape the report's accuracy, performance and sustainability.

In this post I go through the star schema approach — fact and dimension tables, relationships, filter direction and the effect all of this has on report performance — over a sales model.

“A good-looking dashboard impresses at first sight; a well-designed data model strengthens the whole decision process behind the report.”

1. What Is Data Modeling in Power BI?

Data modeling is arranging and relating tables that come from different sources so they can be used meaningfully and correctly in a report. In Power BI the model is not an area where tables simply sit side by side; it is the backbone that defines the filtering logic of the dimensions and the context in which measures are calculated.

01

Accuracy

When the relationships are right, totals, breakdowns and DAX measures give more reliable results.

02

Performance

A simpler, more predictable model reduces unnecessary work in the queries.

03

Sustainability

Adding new measures and report pages stays manageable because the logic of the model is clear.

From the model to the report
  1. Understand
    the Data
  2. Design the
    Model
  3. Build
    Relationships
  4. Analyse
    with DAX
  5. Visualise

2. What Is a Star Schema?

A star schema is a modeling approach with one or more fact tables in the centre and the dimension tables that describe them around it. It gets its name from looking like a star.

The core idea: keep numerical, event-level data in the centre; manage the information that describes the date, product, customer, store or region in the surrounding dimension tables.

The important part is that dimension tables are generally used for filtering and grouping, while the fact table is used to calculate the measures.

3. The Difference Between Fact and Dimension Tables

PropertyFact tableDimension table
PurposeStore events and measurable valuesDescribe and filter the events
ExampleFactSalesDimProduct, DimCustomer, DimDate
Data typeMeasures such as quantity, revenue, cost + keysDescriptive fields such as product, category, customer, city
Row countUsually highUsually lower
UsageThe basis of SUM, AVERAGE, COUNTFiltering, grouping and drill-down

An example FactSales table

SalesIDDateKeyProductKeyCustomerKeyStoreKeyQuantitySalesAmount
1001202610011230142₺1,800
1002202610011830421₺950
1003202610021230943₺2,700

The DateKey, ProductKey, CustomerKey and StoreKey fields in the fact table are the keys that connect it to the surrounding dimension tables.

4. How Are the Relationships Built?

The most common relationship type in a star schema is one-to-many (1:*). A product appears once in the dimension table, while the same product can match hundreds or thousands of sales rows in FactSales.

Model relationships
DimDate[DateKey]          1 ──→ * FactSales[DateKey]
DimProduct[ProductKey]    1 ──→ * FactSales[ProductKey]
DimCustomer[CustomerKey]  1 ──→ * FactSales[CustomerKey]
DimStore[StoreKey]        1 ──→ * FactSales[StoreKey]

When the filter flows from DimProduct to FactSales, the selected category or product automatically affects the sales measures.

Direction

Filter direction

In simple star schemas the dimension → fact direction gives a more controlled design for most scenarios.

Key

Surrogate key

In enterprise models, matching dimension records with a stable key makes maintenance easier.

Important: use bidirectional relationships only when you need them. Unnecessary two-way filters lead to unexpected results and more complex model behaviour.

5. A Simple Sales Data Model

Imagine we are analysing the daily sales of a retail company. We have sales transactions, products, customers, stores and calendar information.

Dimension

DimDate

DateKey, Date, Year, Quarter, Month, MonthName, Week, DayName

Dimension

DimProduct

ProductKey, ProductName, Category, Brand, UnitPrice

Dimension

DimCustomer

CustomerKey, CustomerName, Segment, City, Region

Dimension

DimStore

StoreKey, StoreName, City, Region, StoreType

Fact

FactSales

SalesID, DateKey, ProductKey, CustomerKey, StoreKey, Quantity, SalesAmount, CostAmount

With this structure a question such as “in which month of 2026 did electronics sales in Istanbul grow?” can be answered from a single model. When the user picks a city from DimStore, a category from DimProduct and a year and month from DimDate, the measures on FactSales are filtered accordingly.

Simple DAX measures

A base measure set
Total Sales =
SUM(FactSales[SalesAmount])

Total Quantity =
SUM(FactSales[Quantity])

Total Cost =
SUM(FactSales[CostAmount])

Gross Profit =
[Total Sales] - [Total Cost]

Profit Margin =
DIVIDE([Gross Profit], [Total Sales])

6. How to Build a Star Schema in Power BI

Modeling in Power BI usually starts with preparing the data in Power Query, and the relationships are then created in the model view. To get good results, reduce unnecessary columns and unused data before the report stage.

Step 1

Clean the data

Clean and shape the source tables in Power Query.

Step 2

Separate the tables

Draw a clear line between fact and dimension tables.

Step 3

Create keys

Define unique keys in the dimension tables.

Step 4

Build relationships

Design the relationships as 1:* wherever possible.

Step 5

Add a date table

Create the calendar as its own dimension.

Step 6

Move logic into measures

Collect the calculations in measures as far as you can.

7. The Effect of the Model on Report Performance

Performance in Power BI is not only about hardware or the number of visuals. The structure of the model, the data volume, column cardinality, the relationships and the DAX queries all shape the result together.

Simplicity

The model gets simpler

Organising repeated fields within fact and dimension boundaries makes the model clearer.

Filtering

Filtering becomes clear

The dimension → fact flow makes it predictable which measures a user's selection affects.

DAX

Measures stay readable

Measures focus on the numeric fields of the fact table; dimensions provide the analysis context.

Keeping product, customer, city and category information in dimension tables instead of repeating it endlessly in a huge sales table gives the model a more sensible structure. As the data volume grows, that simplicity and consistency become decisive.

A practical view: if questions like “why is this total wrong?” or “why does this filter also affect that other visual?” come up often, check the data model, not only the DAX formula.

8. Common Data Modeling Mistakes

MistakeWhy is it a problem?Better approach
Trying to solve everything with one tableRepeated fields, complexity and hard maintenanceA proper fact / dimension split
Too many many-to-many relationshipsFilter flow and measure behaviour get complicatedUse a bridge table where needed
Unnecessary bidirectional filteringUnexpected filter propagationKeep a controlled single direction where possible
Not using a date tableTime intelligence and DAX date calculations get harderCreate a standard DimDate
Loading unnecessary columnsModel size and query cost growKeep only the fields you need

9. A Checklist for a Good Power BI Model

Fact

The fact table

Does it represent a single business event? Is the grain clear? Are the measurable fields right?

Dimension

The dimension tables

Are the filter and breakdown fields understandable? Are the keys unique? Is there needless repetition?

Relationship

The relationships

Is the cardinality right? Does the filter direction behave as expected? Are there needlessly complex links?

Performance

Report performance

Has the model been cleared of unused fields? Do measures run in the right context? Were slow visuals investigated?

Conclusion: A Good Report Rests on a Good Model

Effective reporting in Power BI is not only about choosing charts. Building the data model correctly makes measures reliable, filters predictable, new analyses easy to add and the model comfortable to manage over time.

In the star schema approach the fact table keeps measurable events in the centre, while dimension tables describe those events through date, product, customer and store. Correct relationships and a simple model strengthen both the analytical quality and the usability of the report.

“Data modeling is one of the core skills that should come before report design.”