Power BI'da DAX ile Zaman Analizi
Önceki dönem, aylık değişim, yılbaşından bugüne toplam ve büyüme oranı hesaplarını sağlam bir tarih tablosu ve anlaşılır ölçülerle kuruyorum; her ölçünün hangi soruyu yanıtladığını ve nerede yanıltabileceğini anlatıyorum.
- Araçlar
- Veri Görselleştirme

Önce model: tarih tablosu ve ilişki
DAX zaman zekâsı ölçülerinin güvenilir çalışması için gün düzeyinde kesintisiz bir tarih tablosu gerekir. Tarih tablosunu satış tablonuzdaki sipariş tarihiyle bire-çok ilişkilendirin ve tarih filtresinin satış tablosuna aktığından emin olun. Klasik zaman zekâsı yaklaşımında tabloyu Mark as date table ile işaretleyin.
Date =
ADDCOLUMNS(
CALENDAR(MIN(Sales[OrderDate]), MAX(Sales[OrderDate])),
"Year", YEAR([Date]),
"MonthNo", MONTH([Date]),
"Month", FORMAT([Date], "MMMM"),
"YearMonth", FORMAT([Date], "yyyy-MM")
)Month sütununu MonthNo'ya göre sıralayın — aksi hâlde Power BI ay adlarını alfabetik dizer ve grafikte Ağustos, Aralık, Ekim sırası görürsünüz. Tarih tablosu tekil, boş olmayan ve kesintisiz tarihler içermeli.
Sales[SalesAmount], filtreleme ise Date[Date] üzerinden yapılıyor.1. Temel ölçüyü oluşturun
Bütün zaman karşılaştırmaları tek bir temel ölçünün üzerine kurulur. Toplam gibi basit bir hesap için bile hesaplanmış sütun değil, filtre bağlamında yeniden hesaplanan bir ölçü kullanın.
Total Sales =
SUM(Sales[SalesAmount])Grafiğe Date[YearMonth] ekleyip bu ölçüyü değer olarak kullanınca aylık toplamları görürsünüz. Bundan sonraki her ölçü, aynı hesabı farklı bir tarih bağlamında yeniden değerlendirerek çalışacak.
2. Önceki dönemle karşılaştırma
Aylık eksende önceki ayı bulmak için DATEADD ile mevcut tarih bağlamını bir ay geriye kaydırın. Dikkat edilecek nokta şu: bu fonksiyon bağlamdaki aralığı kaydırır. Görselde gün düzeyi seçiliyse bir gün değil, o günün bir ay öncesi gelir; “bir önceki tam ay” istiyorsanız görselin dönem düzeyiyle tutarlı bir seçim yapmalısınız.
Previous Month Sales =
CALCULATE(
[Total Sales],
DATEADD('Date'[Date], -1, MONTH)
)
Change vs Previous Month =
[Total Sales] - [Previous Month Sales]Önceki dönemde veri yoksa ölçünün boş dönmesi genellikle doğru davranıştır — sıfır yazmak “satış olmadı” demektir, oysa gerçek “o dönem henüz yok” olabilir. Yine de sıfır göstermek gerekiyorsa COALESCE([Previous Month Sales], 0) kullanın ve bunun raporda ne anlama geldiğini düşünün.
3. Aylık değişim ve büyüme oranı
Aylık mutlak değişim, mevcut ayın önceki aya göre tutar farkıdır. Göreli değişim ise bu farkın önceki aya oranıdır. Önceki ay sıfırsa bölme tanımsız kalır; DIVIDE hata vermek yerine boş sonuç döndürür.
MoM Change =
[Total Sales] - [Previous Month Sales]
MoM Growth % =
DIVIDE(
[Total Sales] - [Previous Month Sales],
[Previous Month Sales]
)Ölçüyü Power BI'da yüzde biçiminde gösterin; ölçünün içinde ayrıca 100 ile çarpmayın — iki kez yapılırsa %1000'lik büyümeler görürsünüz. Örnek: 120.000 TL'den 132.000 TL'ye çıkış 12.000 TL mutlak değişim ve %10 büyümedir.
4. Geçen yılın aynı dönemi
Mevsimsellik belirginse önceki takvim ayı yerine geçen yılın aynı dönemini kıyaslamak daha anlamlıdır. Perakendede aralık ile kasımı karşılaştırmak çoğu zaman bir şey anlatmaz; aralığı geçen aralıkla karşılaştırmak anlatır.
Sales Same Period LY =
CALCULATE(
[Total Sales],
SAMEPERIODLASTYEAR('Date'[Date])
)
YoY Growth % =
DIVIDE(
[Total Sales] - [Sales Same Period LY],
[Sales Same Period LY]
)Artık yıl ve mali takvim senaryolarında beklenen tarih eşleşmesini mutlaka doğrulayın. Takvim yılı 1 Ocak'ta başlamıyorsa mali yıl ölçülerinde yıl sonunu açıkça tanımlamanız gerekir.
5. Yılbaşından bugüne toplam (YTD)
YTD, seçili yılın başından filtre bağlamındaki tarihe kadar biriken değerdir. Yıllık hedefe ne kadar yaklaşıldığını gün veya ay boyunca kümülatif göstermek için kullanılır.
Sales YTD =
TOTALYTD(
[Total Sales],
'Date'[Date]
)Alternatif olarak CALCULATE([Total Sales], DATESYTD('Date'[Date])) yazılabilir; ikisi aynı sonucu verir. Mali yıl kullanıyorsanız bitiş tarihini parametre olarak ekleyin:
Sales FYTD =
TOTALYTD(
[Total Sales],
'Date'[Date],
"6/30"
)Buradaki "6/30" mali yılın 30 Haziran'da bittiğini söyler. Bu biçimi modelinizde bir matris üzerinde doğrulayın — yanlış mali yıl tanımı tüm kümülatif rakamları sessizce kaydırır.
6. Filtre bağlamı nasıl değişir?
CALCULATE bir ölçüyü yeni bir filtre bağlamında değerlendirir. Grafikte Mart 2026 seçiliyse DATEADD tarih filtresini bir ay geriye kaydırır ve temel satış ölçüsü Şubat tarihleri için yeniden hesaplanır. DAX ölçülerinin dilimleyicilere, satırlara ve sütunlara duyarlı olmasının nedeni budur.
Ürün veya bölge gibi diğer filtreler çoğu zaman olduğu gibi korunur; böylece sonuç “geçerli ürün ve bölge için önceki ay satışı” olur. Beklenmedik bir rakam gördüğünüzde sırayla şunlara bakın: tarih ilişkisi etkin mi, görselde fact tablosunun tarihi mi yoksa tarih tablosunun tarihi mi kullanılıyor, ve hangi dilimleyiciler açık?
Hangi soruda hangi ölçü?
| İş sorusu | Ölçü | Yorum |
|---|---|---|
| Satış önceki aya göre ne kadar değişti? | MoM Change | Para birimi cinsinden fark |
| Önceki aya kıyasla yüzde kaç değişti? | MoM Growth % | Payda önceki ay |
| Geçen yılın aynı dönemine göre büyüme? | YoY Growth % | Mevsimselliği kısmen dengeler |
| Bu yıl şimdiye kadar toplam satış? | Sales YTD | Yıl başından seçili tarihe |
| Önceki dönem satışı kaç? | Previous Month Sales | Geçerli aralığı bir ay geri taşır |
Doğru sonuç için kontrol listesi
Tarih tablosu
Kesintisiz, tekil ve boş değer içermeyen gün düzeyinde bir tablo olmalı.
İlişki
Tarih ilişkisi etkin ve doğru yönde; filtre tarih tablosundan fact'e akmalı.
Görseldeki alan
Grafikte fact tablosunun tarihi değil, Date tablosunun alanı kullanılmalı.
Ay sıralaması
Ay adları MonthNo'ya göre sıralanmalı; alfabetik sıra grafiği bozar.
Biçimlendirme
Ölçü biçimi para birimi veya yüzde olarak ayarlı; ölçü içinde 100 ile çarpmayın.
Tamamlanmamış dönem
Devam eden ay ayrıca işaretlensin; aksi hâlde her rapor düşüş gösterir.
Sık görülen sorunlar
Eksik veya tekrarlı tarihler, ilişkisiz bir tarih tablosu, fact tablosunun kendi tarih hiyerarşisini kullanmak, ay adlarını alfabetik sıralamak ve boş değerleri fark etmeden sıfıra çevirmek en yaygın hatalardır. Bunların ortak özelliği hata vermemeleri — rapor çalışır, sadece yanlış sayı gösterir.
Bu yüzden sıra önemli: önce temel satış ölçüsünü tarih tablosuyla bir matriste doğrulayın, toplamların bildiğiniz rakamlarla tuttuğundan emin olun, sonra zaman zekâsı ölçülerini ekleyin. Temel ölçü yanlışsa üzerine kurulan her şey de yanlış olur.
Temeli doğru tarih modeli oluşturur
DAX zaman analizinin tamamı tek bir fikre dayanır: basit bir satış ölçüsünü CALCULATE ve tarih işlevleriyle farklı dönemlerde yeniden değerlendirmek. Önceki ay, değişim yüzdesi, geçen yıl ve YTD hesaplarının hepsi bunun varyasyonudur.
Ölçülerin anlamını her zaman filtre bağlamı ve iş takvimiyle birlikte raporlayın. “%12 büyüme” cümlesi, neye göre ve hangi dönem tanımıyla hesaplandığı yazılmadığında okuyucuya hiçbir şey söylemez.
Kaynaklar
The model first: date table and relationship
For DAX time intelligence to work reliably you need an unbroken date table at day level. Relate it one-to-many to the order date in your sales table and make sure the date filter flows into sales. With the classic time-intelligence approach, flag the table with Mark as date table.
Date =
ADDCOLUMNS(
CALENDAR(MIN(Sales[OrderDate]), MAX(Sales[OrderDate])),
"Year", YEAR([Date]),
"MonthNo", MONTH([Date]),
"Month", FORMAT([Date], "MMMM"),
"YearMonth", FORMAT([Date], "yyyy-MM")
)Sort the Month column by MonthNo — otherwise Power BI orders month names alphabetically and your chart runs April, August, December. The date table must contain unique, non-blank, uninterrupted dates.
Sales[SalesAmount] and filtering happens through Date[Date].1. Build the base measure
Every time comparison is built on a single base measure. Even for something as simple as a total, use a measure that recalculates in filter context rather than a calculated column.
Total Sales =
SUM(Sales[SalesAmount])Add Date[YearMonth] to a chart and use this measure as the value to see monthly totals. Every measure from here on works by re-evaluating the same calculation in a different date context.
2. Comparing with the previous period
To find the previous month on a monthly axis, shift the current date context back by one month with DATEADD. One thing to watch: the function shifts the range in context. If the visual is at day level, you get that day a month earlier rather than a whole month — for “the previous full month” you need a selection consistent with the visual's period level.
Previous Month Sales =
CALCULATE(
[Total Sales],
DATEADD('Date'[Date], -1, MONTH)
)
Change vs Previous Month =
[Total Sales] - [Previous Month Sales]When there is no data in the previous period, returning blank is usually the correct behaviour — writing zero says “there were no sales”, when the truth may be “that period does not exist yet”. If you still need a zero, use COALESCE([Previous Month Sales], 0) and think about what it means in the report.
3. Monthly change and growth rate
The absolute monthly change is the difference in amount against the previous month. The relative change is that difference over the previous month. If the previous month is zero the division is undefined; DIVIDE returns blank instead of raising an error.
MoM Change =
[Total Sales] - [Previous Month Sales]
MoM Growth % =
DIVIDE(
[Total Sales] - [Previous Month Sales],
[Previous Month Sales]
)Format the measure as a percentage in Power BI; do not also multiply by 100 inside the measure — do both and you will be reporting 1000% growth. For example, a rise from 120,000 to 132,000 is an absolute change of 12,000 and growth of 10%.
4. The same period last year
When seasonality is strong, comparing with the same period last year beats comparing with the previous calendar month. In retail, comparing December with November rarely says anything; comparing December with last December does.
Sales Same Period LY =
CALCULATE(
[Total Sales],
SAMEPERIODLASTYEAR('Date'[Date])
)
YoY Growth % =
DIVIDE(
[Total Sales] - [Sales Same Period LY],
[Sales Same Period LY]
)Always verify the expected date alignment in leap-year and fiscal-calendar scenarios. If the calendar year does not start on 1 January, you have to define the year end explicitly in your fiscal measures.
5. Year-to-date totals
YTD is the value accumulated from the start of the selected year up to the date in filter context. It is used to show cumulative progress against an annual target across days or months.
Sales YTD =
TOTALYTD(
[Total Sales],
'Date'[Date]
)You can also write CALCULATE([Total Sales], DATESYTD('Date'[Date])); both give the same result. If you use a fiscal year, pass the year end as a parameter:
Sales FYTD =
TOTALYTD(
[Total Sales],
'Date'[Date],
"6/30"
)The "6/30" here says the fiscal year ends on 30 June. Verify that format against a matrix in your own model — a wrong fiscal definition quietly shifts every cumulative figure.
6. How filter context changes
CALCULATE evaluates a measure in a new filter context. If March 2026 is selected in the visual, DATEADD shifts the date filter back one month and the base sales measure is recalculated over February's dates. This is exactly why DAX measures respond to slicers, rows and columns.
Other filters such as product or region are usually preserved, so the result becomes “previous month's sales for the current product and region”. When a number surprises you, check in order: is the date relationship active, is the visual using the fact table's date or the date table's, and which slicers are applied?
Which measure for which question?
| Business question | Measure | Note |
|---|---|---|
| How much did sales change from last month? | MoM Change | Difference in currency |
| What percentage change against last month? | MoM Growth % | Previous month is the denominator |
| Growth against the same period last year? | YoY Growth % | Partly offsets seasonality |
| Total sales so far this year? | Sales YTD | From year start to the selected date |
| What were sales in the previous period? | Previous Month Sales | Shifts the current range back a month |
A checklist for correct results
Date table
Uninterrupted, unique and free of blanks, at day level.
Relationship
Active and in the right direction; the filter must flow from date to fact.
Field in the visual
Use the Date table's field in the chart, not the fact table's date.
Month sorting
Month names sorted by MonthNo; alphabetical order ruins the chart.
Formatting
Format as currency or percentage; do not multiply by 100 inside the measure.
Partial periods
Mark the in-progress month separately, or every report shows a decline.
Common problems
Missing or duplicated dates, an unrelated date table, using the fact table's own date hierarchy, sorting month names alphabetically, and turning blanks into zeros without noticing are the most frequent mistakes. What they share is that none of them raise an error — the report runs, it just shows the wrong number.
That is why the order matters: validate the base sales measure against the date table in a matrix first, confirm the totals match numbers you already know, and then add the time intelligence measures. If the base measure is wrong, everything built on it is wrong too.
The date model is the foundation
All of DAX time analysis rests on one idea: re-evaluating a simple sales measure over different periods using CALCULATE and date functions. Previous month, growth percentage, last year and YTD are all variations on that.
Always report what a measure means together with its filter context and the business calendar. The sentence “12% growth” tells the reader nothing unless you have written down what it is measured against and with which period definition.