📈 Power BI DAX examples

Power BI DAX examples

Copy-ready DAX formulas and business measure patterns for Power BI reports. Start with core measures, then move into filter context, iterators, time intelligence and dashboard-ready KPIs.

💡 Ideas for You

Learning resources for Power BI measures, DAX patterns and reporting.

4 useful links

Some links in this section may be affiliate links. Choose only what is useful for your own work.

Browse all Power BI DAX examples

All DAX example pages are shown in one filterable grid so the selected category appears immediately below the search controls.

aggregation

SUM examples

Add numeric values, usually for sales, quantity, cost or hours.

aggregation

AVERAGE examples

Calculate the average value of a numeric column.

aggregation

COUNT examples

Count numeric rows in a column.

aggregation

COUNTA examples

Count non-blank rows in a column.

aggregation

DISTINCTCOUNT examples

Count unique values, such as customers, orders or products.

aggregation

MIN examples

Return the lowest value in a column.

aggregation

MAX examples

Return the highest value in a column.

filter context

CALCULATE examples

Change the filter context of a measure.

filter context

FILTER examples

Return a filtered table for a measure or table expression.

filter context

ALL examples

Remove filters from a table or column.

filter context

ALLEXCEPT examples

Remove filters except for selected grouping columns.

filter context

ALLSELECTED examples

Respect report selections while removing row/visual context.

filter context

REMOVEFILTERS examples

Clear filters in a cleaner CALCULATE expression.

filter context

KEEPFILTERS examples

Add filters without overriding existing filters.

filter context

VALUES examples

Return distinct visible values in the current filter context.

filter context

SELECTEDVALUE examples

Return one selected value or a fallback result.

filter context

HASONEVALUE examples

Check whether exactly one value is selected.

filter context

ISFILTERED examples

Check whether a column is filtered directly.

iterators

SUMX examples

Evaluate an expression row by row and add the results.

iterators

AVERAGEX examples

Evaluate an expression row by row and return the average.

iterators

COUNTX examples

Count rows where an expression returns a non-blank value.

iterators

MAXX examples

Return the maximum result from a row-by-row expression.

iterators

MINX examples

Return the minimum result from a row-by-row expression.

iterators

RANKX examples

Rank products, customers or regions by a measure.

logic

IF examples

Return different results based on a condition.

logic

SWITCH examples

Replace nested IF statements with clearer logic.

logic

AND / OR examples

Combine multiple business conditions.

logic

COALESCE examples

Return the first non-blank expression.

logic

ISBLANK examples

Check whether a measure or column value is blank.

logic

DIVIDE examples

Divide safely without divide-by-zero errors.

time intelligence

TOTALYTD examples

Calculate year-to-date totals.

time intelligence

DATESYTD examples

Return year-to-date dates for a measure.

time intelligence

DATEADD examples

Shift dates by days, months, quarters or years.

time intelligence

SAMEPERIODLASTYEAR examples

Compare the current period with the same period last year.

time intelligence

PREVIOUSMONTH examples

Return dates from the previous month.

time intelligence

NEXTMONTH examples

Return dates from the next month.

time intelligence

DATESINPERIOD examples

Build rolling period calculations.

time intelligence

PARALLELPERIOD examples

Shift a full period for comparison.

time intelligence

STARTOFMONTH / ENDOFMONTH examples

Return the first or last date of the current month.

time intelligence

DATESBETWEEN examples

Filter calculations between two dates.

table functions

SUMMARIZE examples

Create grouped summary tables.

table functions

ADDCOLUMNS examples

Add calculated columns to a table expression.

table functions

SELECTCOLUMNS examples

Create a table with selected/renamed columns.

table functions

CROSSJOIN examples

Create combinations of rows from multiple tables.

table functions

UNION examples

Append rows from tables with matching columns.

table functions

EXCEPT examples

Return rows in one table that are not in another.

table functions

INTERSECT examples

Return rows that appear in both tables.

table functions

TOPN examples

Return the top rows based on a sort expression.

relationships

RELATED examples

Pull a value from the one-side of a relationship.

relationships

RELATEDTABLE examples

Return related rows from the many-side of a relationship.

relationships

USERELATIONSHIP examples

Activate an inactive relationship inside CALCULATE.

relationships

CROSSFILTER examples

Change filter direction for a calculation.

relationships

TREATAS examples

Apply values from one table as filters to another.

text and formatting

FORMAT examples

Convert values to formatted text.

text and formatting

CONCATENATEX examples

Join values from multiple rows into one string.

text and formatting

LEFT / RIGHT / MID examples

Extract parts of text values.

text and formatting

CONTAINSSTRING examples

Check whether text contains a word or phrase.

business measures

Running total examples

Create cumulative totals over time.

business measures

Profit margin examples

Calculate margin as profit divided by revenue.

business measures

Year-over-year growth examples

Compare current sales with last year.

business measures

Average order value examples

Calculate average revenue per order.

business measures

New customers examples

Count customers whose first purchase is in the selected period.

business measures

Customer retention examples

Measure how many customers continue buying.

business measures

Budget vs actual examples

Compare actual performance with a budget or target.

business measures

Dynamic titles examples

Create report titles that respond to slicers.