DAX Cheat Sheet: 50 Functions Every Power BI User Should Know

By Vivek Dhumal • 2026-09-14 • 18 min read
DAX Cheat Sheet: 50 Functions Every Power BI User Should Know
Key Takeaways
  • 50 Most-Used Functions: Covers all essential DAX functions across 10 functional families — aggregation, filter context, time intelligence, logical, text, math and ranking, relationships, table generators, iterators, and variables.
  • Actionable Structure: Every single entry features a plain-English definition, production-ready DAX code, and a practical "when to use it" decision guideline.
  • Mastering Context Transition: The filter and context category (CALCULATE, ALL, ALLSELECTED, KEEPFILTERS) represents the core engine of advanced Power BI report logic.
  • VAR / RETURN Pattern: Storing intermediate measure results in variables improves both VertiPaq execution speed and formula maintainability.
  • Bookmark Worthy: Designed as a fast desktop quick-reference to keep open while modeling in Power BI Desktop or Fabric.

Data Analysis Expressions (DAX) includes over 250 native functions, but 90% of real-world business intelligence challenges are solved using a specific core group of 50. Whether you are building executive KPI scorecards, troubleshooting filter context propagation, or preparing for the Microsoft PL-300 certification, this quick-reference cheat sheet serves as your definitive handbook.

Category 1: Aggregation Functions

The most foundational category. These functions summarize a column or table of values into a single scalar number.

1 SUM

Aggregation

SUM adds up every numeric value in a column, automatically ignoring blanks.

Total Sales = SUM(Sales[Revenue])

When to use: Use SUM when the value you want to total already exists as a physical numeric column in your table. Don't reach for SUM when the calculation needs to happen row by row first — that's SUMX.

2 SUMX

Iterator Aggregator

SUMX iterates through a table row by row, evaluates an expression for each row, then sums the results.

Total Revenue = SUMX(Sales, Sales[Quantity] * RELATED(Products[UnitPrice]))

When to use: Use SUMX whenever the value you're summing doesn't already exist in a single column — for example, when multiplying quantity by unit price across related tables before adding the results up.

3 AVERAGE

Aggregation

AVERAGE returns the arithmetic mean of a numeric column, automatically excluding blank values from both the numerator and the denominator.

Avg Order Value = AVERAGE(Sales[OrderValue])

When to use: The blank-exclusion behavior matters: a column with 10 rows but 2 blanks is averaged over 8 values, not 10. If you want blanks treated as zero, replace them with 0 before averaging.

4 AVERAGEX

Iterator Aggregator

AVERAGEX evaluates an expression for each row in a table, then returns the average of those computed results.

Avg Line Total = AVERAGEX(Sales, Sales[Quantity] * RELATED(Products[UnitPrice]))

When to use: Use AVERAGEX when the value being averaged needs to be calculated row by row across multiple columns or relationships first.

5 COUNT

Aggregation

COUNT counts rows where a specific column contains a numeric value, ignoring blanks and text strings.

Orders With Qty = COUNT(Sales[Quantity])

When to use: If your column contains text (like customer names), use COUNTA instead — COUNT will not count text values.

6 COUNTA

Aggregation

COUNTA counts rows where a column contains any value — numbers, text, or dates — ignoring only true blanks.

Total Customers = COUNTA(Customers[CustomerName])

When to use: Use COUNTA for text and mixed-type columns. Use COUNT specifically when counting only numeric values and explicitly excluding text.

7 COUNTROWS

Table Counting

COUNTROWS counts the total number of rows in a table, regardless of what any individual column contains.

Total Orders = COUNTROWS(Sales)

When to use: COUNTROWS is the fastest, cleanest function when the question is simply "how many rows exist in this table". Use DISTINCTCOUNT when the question is "how many unique entities".

8 DISTINCTCOUNT

Aggregation

DISTINCTCOUNT counts how many unique values exist in a column, treating repeated values as one.

Unique Customers = DISTINCTCOUNT(Sales[CustomerID])

When to use: Ten transactions made by four distinct customers returns 4, not 10. This is the foundation of customer retention and unique entity metrics.

Category 2: Filter and Context Functions

The hardest and most important category in DAX. These functions manipulate filter context — controlling exactly which rows participate in calculation evaluation.

9 CALCULATE

Most Critical DAX Function

CALCULATE evaluates an expression inside a modified filter context — it is how you tell DAX to compute something under conditions different from what visual slicers currently specify.

Sales 2025 = CALCULATE([Total Sales], Sales[Year] = 2025)

When to use: CALCULATE is the central pillar of DAX. It performs context transition (converting row context into filter context) and accepts filter modifiers like ALL, REMOVEFILTERS, and KEEPFILTERS.

10 FILTER

Table Iterator Filter

FILTER iterates a table and returns a subset table containing only the rows that satisfy a boolean condition.

High Value Orders = FILTER(Sales, Sales[OrderValue] > 10000)

When to use: Most commonly used inside CALCULATE when your filter condition compares multiple columns or requires a measure evaluation per row.

11 ALL

Filter Removal

ALL removes all active filters from a table or column, returning every row regardless of what filters are selected in the visual or slicers.

% of Grand Total = DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Sales)))

When to use: The foundation of all "percent of grand total" metrics. The denominator clears all slicer selections to compute the unfiltered grand baseline.

12 ALLEXCEPT

Selective Filter Removal

ALLEXCEPT removes every filter from a table except for the specific columns explicitly preserved in the argument list.

Regional % = DIVIDE([Total Sales], CALCULATE([Total Sales], ALLEXCEPT(Sales, Sales[Region])))

When to use: Use when clearing product or date filters while keeping a regional partition intact.

13 ALLSELECTED

Visual Filter Preservation

ALLSELECTED removes filters added internally inside a matrix visual row/column, while still honoring user-selected outer slicers and page filters.

% of Visible Total = DIVIDE([Total Sales], CALCULATE([Total Sales], ALLSELECTED(Sales)))

When to use: Reach for ALLSELECTED when your "percent of total" should dynamically sum up to 100% across the items currently visible under the user's active slicers.

14 REMOVEFILTERS

Modern Filter Modifier

REMOVEFILTERS removes filters from specified columns or tables inside a CALCULATE call — providing a clear, self-documenting syntax.

Total Ignoring Region = CALCULATE([Total Sales], REMOVEFILTERS(Sales[Region]))

When to use: Preferred in modern enterprise DAX over ALL when used strictly as a filter modifier inside CALCULATE because its name explicitly states the operational intent.

15 KEEPFILTERS

Context Intersect

KEEPFILTERS forces a filter argument inside CALCULATE to intersect with existing filters rather than overriding and replacing them.

Sales North = CALCULATE([Total Sales], KEEPFILTERS(Sales[Region] = "North"))

When to use: Use when you want a calculation to respect visual-level exclusions without silently overriding user filter selections.

16 SELECTEDVALUE

Scalar Extraction

SELECTEDVALUE returns the single value of a column when exactly one value is filtered in context, returning a fallback string or blank if multiple values exist.

Dynamic Header = "Sales for " & SELECTEDVALUE(Sales[Region], "All Regions")

When to use: Essential for dynamic chart titles, KPI card subtitles, and conditional measures driven by slicers.

17 HASONEVALUE

Context Validation

HASONEVALUE returns TRUE when a column has exactly one distinct value in the current filter context, and FALSE otherwise.

Region Label = IF(HASONEVALUE(Sales[Region]), VALUES(Sales[Region]), "Multiple")

When to use: Guard calculations that should only execute on individual matrix rows, hiding confusing results on total rows.

Category 3: Time Intelligence Functions

Time intelligence functions require a dedicated, continuous calendar table marked as the date table in Power BI.

18 TOTALYTD

Year-to-Date

TOTALYTD calculates a year-to-date running total from the beginning of the year through the latest date in the current filter context.

YTD Sales = TOTALYTD([Total Sales], 'Calendar'[Date])

When to use: For custom fiscal years ending on June 30, supply the optional third parameter: TOTALYTD([Total Sales], 'Calendar'[Date], "06-30").

19 TOTALQTD

Quarter-to-Date

TOTALQTD calculates a quarter-to-date running total from the first day of the current quarter through the active date context.

QTD Sales = TOTALQTD([Total Sales], 'Calendar'[Date])

When to use: Pair with TOTALYTD and TOTALMTD to build complete executive timeframe matrices.

20 SAMEPERIODLASTYEAR

Prior Year Shift

SAMEPERIODLASTYEAR shifts the dates in the current filter context exactly one full year backward.

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

When to use: The standard industry function for Year-over-Year (YoY) revenue and margin comparisons.

21 DATEADD

Flexible Time Shift

DATEADD shifts the dates in the current filter context forward or backward by a specified number of intervals (DAY, MONTH, QUARTER, YEAR).

Sales 3M Ago = CALCULATE([Total Sales], DATEADD('Calendar'[Date], -3, MONTH))

When to use: Much more versatile than SAMEPERIODLASTYEAR when building rolling 3-month or custom multi-interval shifts.

22 DATESYTD

Table Function

DATESYTD returns a single-column table of dates starting from the beginning of the year through the latest date in context.

YTD Filtered = CALCULATE([Total Sales], DATESYTD('Calendar'[Date]), Products[Category] = "Audio")

When to use: Use inside CALCULATE when combining YTD date ranges with multiple explicit dimension filters.

23 PREVIOUSMONTH

Month-over-Month

PREVIOUSMONTH returns a table containing all calendar dates from the previous complete calendar month.

PM Sales = CALCULATE([Total Sales], PREVIOUSMONTH('Calendar'[Date]))

When to use: Cleaner and more readable than DATEADD('Calendar'[Date], -1, MONTH) for month-over-month variances.

24 PARALLELPERIOD

Full Period Shift

PARALLELPERIOD shifts a date selection forward or backward by a number of full calendar periods, always expanding to complete periods.

PY Total Sales = CALCULATE([Total Sales], PARALLELPERIOD('Calendar'[Date], -1, YEAR))

When to use: If your active context is June 10–20, DATEADD(-1, MONTH) evaluates May 10–20, but PARALLELPERIOD(-1, MONTH) evaluates the full month of May (1–31).

25 DATESBETWEEN

Fixed Date Window

DATESBETWEEN returns a table of dates between a specified start date and end date.

Promo Sales = CALCULATE([Total Sales], DATESBETWEEN('Calendar'[Date], DATE(2026,11,20), DATE(2026,11,30)))

When to use: Ideal for fixed marketing campaigns, Black Friday sales windows, or custom corporate budget cycles.

Category 4: Logical Functions

Branching logic, multi-condition rule evaluations, and non-blank coalescing.

26 IF

Logical Branching

IF evaluates a logical test and returns one value if true, and a second value if false.

Status = IF([Total Sales] > 50000, "On Target", "Needs Attention")

When to use: Use for simple binary conditions. If you find yourself nesting more than 2 IF statements, refactor immediately to SWITCH.

27 SWITCH

Multi-Condition Evaluator

SWITCH evaluates an expression against a list of values or multiple boolean conditions, returning the result of the first matching branch.

Tier = 
SWITCH(TRUE(),
    [Total Sales] > 100000, "Platinum",
    [Total Sales] > 50000, "Gold",
    [Total Sales] > 20000, "Silver",
    "Bronze"
)

When to use: The SWITCH(TRUE(), ...) pattern is the gold standard for readable tier classification and performance band logic.

28 AND / &&

Logical Conjunction

AND returns TRUE only when both tested conditions evaluate to true.

HighValueActive = AND([Total Sales] > 10000, [Order Count] > 5)
// Or using inline operator:
HighValueActive2 = [Total Sales] > 10000 && [Order Count] > 5

When to use: The && operator syntax is standard across professional DAX code bases for chaining multiple conditions.

29 OR / ||

Logical Disjunction

OR returns TRUE if at least one of the conditions evaluates to true.

PriorityRegion = [Region] = "North" || [Region] = "East"

When to use: Use || for multiple conditions, or Sales[Region] IN {"North", "East"} for checking sets of discrete values.

30 COALESCE

Fallback Resolution

COALESCE evaluates arguments from left to right and returns the first non-blank value.

CustomerDisplayName = COALESCE(Customer[PreferredName], Customer[LegalName], "Anonymous")

When to use: Modern, performant replacement for messy nested IF(ISBLANK(...), ...) fallback chains.

Category 5: Text Functions

String concatenation, dynamic formatting, and substring manipulation.

31 CONCATENATE / &

String Joining

CONCATENATE joins two text strings into a single text output.

FullName = Customer[FirstName] & " " & Customer[LastName]

When to use: Use the & ampersand operator to concatenate more than two elements in a single readable line.

32 FORMAT

Custom String Mask

FORMAT converts numeric or date values into formatted text strings according to a format string pattern.

MonthLabel = FORMAT('Calendar'[Date], "MMM YYYY") // e.g. "Sep 2026"
SalesCard = FORMAT([Total Sales], "$#,##0.00")

When to use: Essential for card labels and dynamic titles. Remember that the output is text, so it cannot be aggregated numerically.

33 LEFT

Substring

LEFT returns a specified number of characters from the start of a text string.

AreaCode = LEFT(Customers[Phone], 3)

When to use: Use alongside RIGHT and MID for parsing structured keys or prefix codes.

34 LEN

String Length

LEN counts the number of characters in a text string.

IsValidSKU = IF(LEN(Products[SKU]) = 8, "Valid", "Invalid Length")

When to use: Data validation, error flagging, and dynamic position parsing.

Category 6: Math and Ranking Functions

Division safety, rounding algorithms, and dynamic ranking calculations.

35 DIVIDE

Best Practice Division

DIVIDE performs division and automatically returns a fallback value or blank instead of throwing a divide-by-zero exception.

Margin % = DIVIDE([Gross Profit], [Total Revenue], 0)

When to use: Always use DIVIDE rather than the / forward slash operator across all DAX measures to prevent report visual crashes.

36 ABS

Absolute Value

ABS returns the absolute positive magnitude of a numeric number.

VarianceMagnitude = ABS([Actual Sales] - [Budget Sales])

When to use: Variance tolerance checks, error thresholding, and distance metrics.

37 ROUND

Numeric Precision

ROUND rounds a number to a specified number of decimal places.

RoundedK = ROUND([Total Revenue] / 1000, 1)

When to use: Precision clipping and financial summary rounding. Use ROUNDUP or ROUNDDOWN for ceiling/floor control.

38 RANKX

Dynamic Ranking

RANKX evaluates an expression across a table and assigns a rank ordinal according to sorted values.

ProductRank = RANKX(ALL(Products[ProductName]), [Total Sales], , DESC, Dense)

When to use: Top N filtering, salesperson leaderboards, and regional rankings. Use Dense tie-breaking for consecutive rank values.

Category 7: Relationship Functions

Traversing active and inactive relationships across the star schema model.

39 RELATED

Many-to-One Lookup

RELATED retrieves a value from a lookup table following an existing active relationship from the many side to the one side.

CategoryName = RELATED(Products[Category])

When to use: Inside row contexts (such as calculated columns or iterator expressions like SUMX) on a fact table.

40 RELATEDTABLE

One-to-Many Table Fetch

RELATEDTABLE returns all rows from a related table that correspond to the current row context.

ProductOrderCount = COUNTROWS(RELATEDTABLE(Sales))

When to use: Used on the one-side dimension table (like Products) to count or aggregate rows in the related transaction fact table.

41 LOOKUPVALUE

Relationship-Free Search

LOOKUPVALUE retrieves a value from a target table matching one or more search conditions without requiring a model relationship.

Manager = LOOKUPVALUE(Managers[Name], Managers[RegionID], Sales[RegionID])

When to use: Use when tables cannot be joined directly in the semantic model due to ambiguity or circular dependencies.

42 USERELATIONSHIP

Role-Playing Dates

USERELATIONSHIP temporarily activates an inactive relationship between two columns for the duration of a single CALCULATE evaluation.

OrdersByShipDate = CALCULATE([Total Orders], USERELATIONSHIP(Sales[ShipDate], 'Calendar'[Date]))

When to use: Crucial when fact tables contain multiple date keys (OrderDate, ShipDate, DeliveryDate) linked to a single calendar table.

Category 8: Table Functions

Generating intermediate virtual tables, extracting distinct lists, and grouping aggregations.

43 VALUES

Unique Column Values

VALUES returns a single-column table of unique values respecting the current filter context, including a blank row for unmatched keys.

ActiveRegions = VALUES(Sales[Region])

When to use: Feeding lists of values into table iterators or as filter arguments inside CALCULATE.

44 DISTINCT

Strict Unique List

DISTINCT returns a table of unique values from a column or table, strictly excluding the automated blank row generated by relationship mismatches.

UniqueProducts = DISTINCT(Sales[ProductID])

When to use: Use DISTINCT when unmatched relationship keys should not produce an artificial blank row in intermediate tables.

45 SUMMARIZE

Group By Aggregation

SUMMARIZE creates a virtual summary table grouped by one or more dimension columns.

RegionSummary = SUMMARIZE(Sales, Sales[Region], "Revenue", SUM(Sales[Revenue]))

When to use: Use to group data before feeding into higher-level iterators like AVERAGEX or MINX.

46 ADDCOLUMNS

Virtual Table Enrichment

ADDCOLUMNS appends one or more calculated columns to an existing table expression inside a virtual variable block.

VirtualTable = 
ADDCOLUMNS(
    VALUES(Products[Category]),
    "CategorySales", [Total Sales],
    "TargetSales", [Budget Sales]
)

When to use: Best practice pattern is combining SUMMARIZE for grouping and ADDCOLUMNS for measure evaluation.

Category 9: Iterator Extensions

Row-by-row table evaluation for extrema and custom calculations.

47 MINX

Minimum Iterator

MINX iterates through a table row by row, evaluates an expression for each row, and returns the smallest value.

LowestOrderValue = MINX(Sales, Sales[Quantity] * RELATED(Products[UnitPrice]))

When to use: When calculating the minimum of an expression calculated across multiple columns or relationships.

48 MAXX

Maximum Iterator

MAXX iterates through a table, evaluates an expression per row, and returns the highest resulting value.

HighestDailySales = MAXX(VALUES('Calendar'[Date]), [Total Sales])

When to use: Finding single-day peak sales across a multi-month period.

Category 10: Variables and Information Functions

Performance optimization, intermediate caching, and visual context introspection.

49 VAR / RETURN

Performance & Readability

VAR evaluates and stores the result of an expression once inside a formula; RETURN yields the final output using those variables.

YoY Growth % = 
VAR CurrentSales = [Total Sales]
VAR PriorSales = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Calendar'[Date]))
RETURN
    DIVIDE(CurrentSales - PriorSales, PriorSales)

When to use: Use variables in every non-trivial DAX formula. They prevent redundant recalculations and make testing step-by-step intermediate results effortless.

50 ISBLANK

Null Detection

ISBLANK returns TRUE if an expression evaluates to blank or null, and FALSE otherwise.

SalesDisplay = IF(ISBLANK([Total Sales]), "No Transactions", FORMAT([Total Sales], "$#,##0"))

When to use: Cleaning up blank scorecard tiles and replacing empty cells with informative business messages.

+ ISINSCOPE (Bonus Essential)

Hierarchy Matrix Control

ISINSCOPE returns TRUE when a specified column is currently being used as a grouping level in the active visual hierarchy.

DynamicSubtotal = 
IF(
    ISINSCOPE(Products[ProductName]),
    [Total Sales],
    [Total Sales] * 1.05 // Custom subtotal weighting
)

When to use: The most robust function for customizing visual subtotal and grand total rows in financial matrices.

Quick-Reference Summary Table

# Function Category One-Line Primary Job
1SUMAggregationTotal a column directly
2SUMXAggregationTotal a row-by-row calculated expression
3AVERAGEAggregationArithmetic mean of numeric column
4AVERAGEXAggregationAverage a row-by-row calculation
5COUNTAggregationCount numeric values
6COUNTAAggregationCount any non-blank values (including text)
7COUNTROWSAggregationCount total rows in a table
8DISTINCTCOUNTAggregationCount distinct unique values
9CALCULATEFilter ContextEvaluate under modified filter conditions
10FILTERFilter ContextReturn subset table matching condition
11ALLFilter ContextRemove all active filters from table/column
12ALLEXCEPTFilter ContextRemove all filters except named columns
13ALLSELECTEDFilter ContextRemove visual filters, retain user slicers
14REMOVEFILTERSFilter ContextExplicit filter removal modifier
15KEEPFILTERSFilter ContextIntersect new filter with existing context
16SELECTEDVALUEFilter ContextExtract single filtered value or fallback
17HASONEVALUEFilter ContextCheck if column has 1 value in context
18TOTALYTDTime IntelligenceYear-to-date accumulated total
19TOTALQTDTime IntelligenceQuarter-to-date accumulated total
20SAMEPERIODLASTYEARTime IntelligenceShift date context 1 full year back
21DATEADDTime IntelligenceShift dates by N intervals
22DATESYTDTime IntelligenceTable of YTD dates for CALCULATE
23PREVIOUSMONTHTime IntelligenceTable of prior calendar month dates
24PARALLELPERIODTime IntelligenceShift by full completed periods
25DATESBETWEENTime IntelligenceTable of dates in fixed interval
26IFLogicalBinary condition test
27SWITCHLogicalMulti-branch decision evaluator
28AND / &&LogicalBoth conditions must be true
29OR / ||LogicalAt least one condition true
30COALESCELogicalReturn first non-blank argument
31CONCATENATE / &TextJoin strings together
32FORMATTextFormat number/date into string pattern
33LEFTTextExtract N characters from start
34LENTextCount string character length
35DIVIDEMathSafe division preventing divide-by-zero
36ABSMathAbsolute positive value magnitude
37ROUNDMathRound to N decimal places
38RANKXMath & RankingRank expression within a table
39RELATEDRelationshipLookup value (many-to-one)
40RELATEDTABLERelationshipFetch related rows (one-to-many)
41LOOKUPVALUERelationshipLookup value without relationship
42USERELATIONSHIPRelationshipActivate inactive relationship in CALCULATE
43VALUESTableUnique values table (with blank row)
44DISTINCTTableUnique values table (excluding blank)
45SUMMARIZETableGroup by and aggregate table
46ADDCOLUMNSTableAppend calculated columns to virtual table
47MINXIteratorMinimum of row-by-row calculation
48MAXXIteratorMaximum of row-by-row calculation
49VAR / RETURNVariablesStore and reuse intermediate calculations
50ISBLANKInformationDetect blank/null expressions

Recommended Next Guides & Deep Dives

Continue expanding your Power BI and Fabric architecture knowledge with these closely connected tutorials:

Frequently Asked Questions

Which DAX function should I learn first?

CALCULATE is the single most important function in DAX. Everything else in the filter context family (ALL, REMOVEFILTERS, KEEPFILTERS) exists to modify CALCULATE expressions. Master CALCULATE and the remainder of DAX becomes intuitive.

What is the difference between SUMX and SUM in Power BI?

SUM totals an existing physical column directly. SUMX is an iterator function that evaluates an expression row-by-row (such as multiplying Quantity by Unit Price across relationships) before adding the results up.

When should I use VAR in DAX formulas?

Use VAR whenever an intermediate calculation is referenced more than once, or when breaking down complex logic makes the code easier to read. Variables calculate once and cache the value in memory, improving both execution speed and debugging.

What is the difference between ALL and ALLSELECTED?

ALL clears all filters from a table or column, including filters applied by user slicers. ALLSELECTED clears internal visual filters (like matrix rows) while preserving user-selected outer slicers and page-level filters.

Why should I use DIVIDE instead of the forward slash operator (/)?

The / operator produces an error or NaN if the denominator is zero or blank. DIVIDE handles zero denominators safely by returning blank or an optional fallback value without crashing visual components.

What is the difference between VALUES and DISTINCT?

Both return unique lists of values. However, if your data model contains unmatched relationship keys, VALUES includes an artificial blank row to account for those orphaned records, whereas DISTINCT strictly excludes it.

Vivek Dhumal

Vivek Dhumal

BI Consultant

BI Consultant & Power BI Developer

Vivek Dhumal is a dedicated BI Consultant and Data Analyst specializing in Power BI development, DAX calculations, SQL data modeling, ETL automation, and scalable business intelligence solutions.