Power BI DAX Cheatsheet

Complete DAX Referentie Gids voor Data Analysis

Download versie: v2.1 | Bijgewerkt: Jan 2025
💡 Tip: DAX (Data Analysis Expressions) is de formule taal van Power BI. Gebruik deze cheatsheet als snelle referentie tijdens het ontwikkelen van rapporten.
📊 Aggregatie Functies
Basic Aggregation
SUM()
SUM(column)
Telt alle waarden in een kolom op
Total Sales = SUM(Sales[Amount])
Basic Aggregation
AVERAGE()
AVERAGE(column)
Berekent het gemiddelde van een kolom
Avg Price = AVERAGE(Products[Price])
Basic Aggregation
COUNT()
COUNT(column)
Telt alle niet-lege cellen in een kolom
Order Count = COUNT(Orders[OrderID])
Basic Aggregation
DISTINCTCOUNT()
DISTINCTCOUNT(column)
Telt unieke waarden in een kolom
Unique Customers = DISTINCTCOUNT(Sales[CustomerID])
Basic Aggregation
MIN() / MAX()
MIN(column) / MAX(column)
Vindt de kleinste/grootste waarde
Min Date = MIN(Sales[OrderDate]) Max Amount = MAX(Sales[Amount])
📅 Time Intelligence Functies
Period Calculations
TOTALYTD()
TOTALYTD(expression, dates[, filter][, year_end_date])
Year-to-date totalen berekenen
Sales YTD = TOTALYTD([Total Sales], 'Date'[Date])
Period Calculations
TOTALQTD() / TOTALMTD()
TOTALQTD(expression, dates[, filter])
Quarter/Month-to-date totalen
Sales QTD = TOTALQTD([Total Sales], 'Date'[Date])
Date Comparison
SAMEPERIODLASTYEAR()
SAMEPERIODLASTYEAR(dates)
Vergelijking met vorig jaar
Sales PY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
Date Comparison
DATEADD()
DATEADD(dates, number_of_intervals, interval)
Voeg tijdsintervallen toe aan data
Next Month = DATEADD('Date'[Date], 1, MONTH)
Period Functions
DATESBETWEEN()
DATESBETWEEN(dates, start_date, end_date)
Data tussen twee datums selecteren
Last 30 Days = CALCULATE([Total Sales], DATESBETWEEN('Date'[Date], TODAY()-30, TODAY()))
🔍 Filter & Context Functies
Context Modification
CALCULATE()
CALCULATE(expression, filter1, filter2, ...)
Wijzigt filtercontext van een berekening
Premium Sales = CALCULATE([Total Sales], Customer[Segment] = "Premium")
Context Modification
FILTER()
FILTER(table, expression)
Filtert een tabel op basis van een conditie
High Value Customers = CALCULATE([Total Sales], FILTER(Customer, Customer[Sales] > 10000))
Context Functions
ALL()
ALL(table/column)
Verwijdert alle filters
Total Sales All = CALCULATE([Total Sales], ALL(Sales))
Context Functions
ALLEXCEPT()
ALLEXCEPT(table, column1, column2, ...)
Verwijdert alle filters behalve opgegeven kolommen
Sales by Region = CALCULATE([Total Sales], ALLEXCEPT(Sales, Sales[Region]))
Context Functions
VALUES()
VALUES(column)
Retourneert unieke waarden in huidige context
Selected Products = VALUES(Product[Name])
📝 Text & Informatie Functies
Functie Syntaxis Beschrijving Voorbeeld
CONCATENATE() CONCATENATE(text1, text2) Combineert tekststrings Full Name = CONCATENATE([FirstName], " ", [LastName])
LEFT() / RIGHT() LEFT(text, num_chars) Extraheert links/rechts deel van tekst First 3 Chars = LEFT([ProductCode], 3)
FIND() FIND(find_text, within_text) Vindt positie van tekst binnen tekst Pos = FIND("@", [Email])
ISBLANK() ISBLANK(value) Controleert of waarde leeg is Has Email = NOT(ISBLANK([Email]))
ISERROR() ISERROR(value) Controleert op fouten Valid = NOT(ISERROR([Calculation]))
💡 Algemene DAX Patronen
YoY Growth
Sales YoY Growth = VAR CurrentYear = [Total Sales] VAR PreviousYear = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])) RETURN DIVIDE(CurrentYear - PreviousYear, PreviousYear, 0)
Running Total
Running Total = CALCULATE( [Total Sales], FILTER( ALL('Date'[Date]), 'Date'[Date] <= MAX('Date'[Date]) ) )
Top N Selection
Top 5 Products = CALCULATE( [Total Sales], TOPN( 5, VALUES(Product[Name]), [Total Sales] ) )
Percentage of Total
Sales % of Total = DIVIDE( [Total Sales], CALCULATE([Total Sales], ALL(Product)) )
⚡ Performance Tips
1. Gebruik VARIABLES: Verbeter leesbaarheid en performance
Efficient Measure = VAR TotalRevenue = SUM(Sales[Revenue]) VAR TotalCost = SUM(Sales[Cost]) RETURN TotalRevenue - TotalCost
2. Vermijd EARLIER(): Gebruik in plaats daarvan CALCULATE + FILTER
3. Gebruik SUMMARIZE spaarzaam: Kan traag zijn bij grote datasets
4. Optimaliseer relationships: Gebruik star schema voor beste performance
📋 Snelle Referentie
Doel Gebruik Voorbeeld
Totaal berekenen SUM() SUM(Sales[Amount])
Gemiddelde berekenen AVERAGE() AVERAGE(Products[Price])
Unieke waarden tellen DISTINCTCOUNT() DISTINCTCOUNT(Customers[ID])
Year-to-date TOTALYTD() TOTALYTD([Sales], Dates[Date])
Filter toepassen CALCULATE() CALCULATE([Sales], Region="West")
Rangschikking RANKX() RANKX(ALL(Products), [Sales])

Hoe te gebruiken:

1. Print deze pagina als PDF (Ctrl+P → Save as PDF)

2. Kopieer naar Word voor aanpassingen

3. Bewaar als referentie op je bureau of als desktop shortcut