Get a Quote +90 553 510 56 56
Power BI 24 April 2026 · 9 min read

DAX Formulas: Complex Measures in 10 Critical Examples

10 DAX formulas frequently needed in Power BI and practical usage examples; YoY, MoM, YTD, ratio calculations and more.

Power BI DAX Formula
📄 SalesReport.pbix — DAX Editor Th 01 Total Sales = SUM (Sales[Amount]) 02 YTD Sales = CALCULATE ( [Total Sales] , DATESYTD (Date[Date])) 03 YoY % = DIVIDE ( [Total Sales] - [PY Sales] , [PY Sales] ) 04 Top 10 Customers = RANKX ( ALL (Customer[Name]), [Total Sales] ) 05 Safe Divide = DIVIDE ([Num], [Den], 0) ✓ 5 ölçü doğrulandı Sorgu süresi: 42ms · Formatlanmış · Dependencies OK

The most common mistake when learning DAX is memorizing functions in isolation. The right way is to build the measures frequently needed in real business scenarios, example by example. In this article we'll cover 10 practical DAX examples.

01. Sales Total and the Total Measure

The most basic measure: Total Sales = SUM(Sales[Amount]). If you define this as a measure, it becomes filter-sensitive; if you add it as a column, it stays static.

02. Year-over-Year (YoY) Growth

YoY Growth % = DIVIDE([Total Sales] - CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Date[Date])), CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Date[Date]))). This measure gives the growth percentage versus last year.

03. Year-to-Date (YTD)

YTD Sales = CALCULATE([Total Sales], DATESYTD(Date[Date])). Total sales from the start of the year to today. Critical in monthly reports.

04. Moving Average (7-Day)

7d MA = AVERAGEX(DATESINPERIOD(Date[Date], LASTDATE(Date[Date]), -7, DAY), [Total Sales]). Ideal for smoothing short-term trends.

05. Top N Customers

Top 10 Customers = RANKX(ALL(Customer[Name]), [Total Sales]). If a filter constraint of <=10 is added, it returns the top 10 customers.

06. Contribution %

Contribution % = DIVIDE([Total Sales], CALCULATE([Total Sales], ALLSELECTED())). Gives the contribution share to the total within the selected filter.

07. Running Total

Running Total = CALCULATE([Total Sales], FILTER(ALLSELECTED(Date[Date]), Date[Date] <= MAX(Date[Date]))). For a cumulative-total chart.

08. What-If Parameters

New Target = SELECTEDVALUE(TargetParam[Value]) * [Base Value]. Lets the user change scenarios with a slider.

09. Today's Value

Today Sales = CALCULATE([Total Sales], Date[Date] = TODAY()). Needed for real-time indicators.

10. Blank Check

Safe Divide = DIVIDE([Numerator], [Denominator]). Doesn't throw a divide-by-zero error; returns blank instead. A small but life-saving function.

We can help you with this

Explore our Power BI solution

You can book a free consultation call to get detailed information.

View the Page Get a Quote
Power BI articles

Other Articles on This Topic

Power BI

Power BI Data Model: The Anatomy of a Correct Setup with the Star Schema

26 June 2026 · 9 min read
Power BI

An Introduction to Business Intelligence with Power BI: A Getting-Started Guide

20 June 2026 · 8 min read
All articles