How to Create a Measure in Power BI

Cody Schneider9 min read

Creating a measure in Power BI is how you unlock custom calculations that turn raw data into meaningful business insights. These simple formulas allow you to calculate anything from total sales to year-over-year growth, making your reports dynamic and truly responsive to your needs. This guide will walk you through exactly what measures are, why they are different from calculated columns, and how to create them step-by-step.

What Exactly Is a Measure in Power BI?

Think of a measure as a dynamic, on-demand calculation. It's a formula, written in a language called DAX (Data Analysis Expressions), that calculates a result based on the context of your report. Unlike static values in a spreadsheet cell, a measure recalculates itself every time you interact with a report - like when you apply a filter, select an option in a slicer, or click on a bar in a chart.

For example, you could create a measure called "Total Sales." When you drop this measure into a card visual, it shows the grand total of all sales. But when you put that same measure into a bar chart broken down by product category, it automatically calculates and shows the total sales for each individual category. If you then filter the report page for the year 2023, the measure instantly updates to show the sales for each category within that year.

Common examples of measures include:

  • Total Revenue
  • Average Order Value
  • Profit Margin Percentage
  • Count of Site Visitors
  • Year-Over-Year Customer Growth

Measures are the workhorses of Power BI reporting, responsible for nearly all of the key performance indicators (KPIs) you see in a typical dashboard.

Measures vs. Calculated Columns: Understanding the Key Difference

One of the biggest hurdles for beginners is understanding the difference between a measure and a calculated column. They both use DAX formulas, but they function in fundamentally different ways and are used for different purposes. Grasping this distinction is foundational to building efficient and effective Power BI models.

Calculated Columns

A calculated column adds a new column to one of your tables. The formula is evaluated for each row in that table during the data refresh process, and the results are stored directly in your data model. This means a calculated column physically enlarges your file size.

Key characteristics of calculated columns:

  • Row Context: The calculation happens one row at a time, using only the data available in that specific row. For example, you could create a [TotalPrice] column in a sales table with the formula Sales[Quantity] * Sales[UnitPrice].
  • Static: The values are calculated during data refresh and don't change based on user interaction in the report.
  • Memory Intensive: Since the results for every row are stored, calculated columns can significantly increase the memory consumption and file size of your report, especially with large datasets.
  • When to use them: Use a calculated column when you need a static value that pertains to a specific row. They are perfect for creating categories that you want to use in a slicer, filter, or as an axis in a chart. For instance, creating a "Price Tier" column that assigns 'High', 'Medium', or 'Low' to each product based on its price.

Measures

A measure, on the other hand, doesn’t store any values in your model. It's just a formula waiting to be executed. The calculation happens on the fly in response to the user's view of the data.

Key characteristics of measures:

  • Filter Context: Measures operate on aggregated data based on the filters applied in the report (from visuals, slicers, or other filters). They don't have row context on their own. For example, a SUM(Sales[Revenue]) measure looks at the entire [Revenue] column after any active filters are applied.
  • Dynamic: The result updates instantly with every interaction a user has with the report.
  • Lightweight: Since only the formula is stored and not the results, measures have a negligible impact on your file size.
  • When to use them: Use measures for almost all aggregation-based calculations, like sums, averages, counts, and ratios. They are ideal for displaying KPIs in cards, values in charts, and performing a wide range of analytical calculations that need to respond to user context.

A good rule of thumb: If you need a value you can see in a table row-by-row, consider a calculated column. For nearly everything else – especially values that appear in chart totals or summary cards – a measure is the right choice.

A Quick Intro to DAX: The Language of Measures

To create measures, you'll need to write a little DAX (Data Analysis Expressions). Don't let that intimidate you, if you've ever written a formula in Excel, DAX will feel familiar. It's a library of functions and operators that you combine to build formulas.

DAX functions include:

  • Aggregation Functions: SUM, AVERAGE, MIN, MAX, COUNT
  • Logical Functions: IF, AND, OR, SWITCH
  • Time Intelligence Functions: TOTALYTD, SAMEPERIODLASTYEAR, DATESINPERIOD
  • The Master Function: CALCULATE, the most powerful and versatile function in DAX, which allows you to modify the filter context of a calculation.

You don't need a deep understanding of every DAX function to get started. You can build powerful reports by mastering just a few basic ones.

A Step-by-Step Guide to Creating Your First Measure

Let's walk through creating a simple but essential measure: "Total Revenue". For this example, imagine you have a table named Sales with columns named UnitsSold and PricePerUnit.

Step 1: Choose Where to Create the Measure

In Power BI Desktop, look at the Fields pane on the right. You can right-click on the Sales table (or any table) and select New measure. Alternatively, you can click on the table name and then click the New Measure button in the ribbon menu at the top.

Pro Tip: As you create more measures, it's a best practice to organize them. You can create a dedicated "Measures Table" — a blank table that holds all your custom calculations — to keep your model tidy.

Step 2: Write the DAX Formula

Once you click "New measure", the formula bar will appear at the top. Power BI provides a default name Measure =. First, replace Measure with a descriptive name, like Total Revenue, followed by the equals sign.

Now, write the DAX formula. We need to multiply the units sold by the price for each row and then sum those results up. For this, the SUMX function is perfect. It iterates through a table row by row, performs a calculation, and then sums the results.

Your formula will look like this:

Total Revenue = SUMX(Sales, Sales[UnitsSold] * Sales[PricePerUnit])

As you type, Power BI's IntelliSense will help you by suggesting functions and table/column names, which helps prevent typos.

After writing the formula, press Enter or click the checkmark icon to commit it.

Step 3: Format Your Measure

Look in your Fields pane. You will see Total Revenue under the Sales table, accompanied by a small calculator icon. Click on the measure to select it.

A new contextual tab called Measure tools will appear in the ribbon. Here, you can format your measure. Click the dropdown that says "General" and select "Currency." Then, click the dollar sign symbol and adjust the number of decimal places if needed. Formatting ensures your measure looks professional and is easy to read in visuals.

Step 4: Use Your New Measure in a Visual

Now for the satisfying part! Go to your report canvas and add a visual, like a Card visual from the Visualizations pane. With the card selected, find your Total Revenue measure in the Fields pane and either drag and drop it onto the visual or just check the box next to it.

Voila! You now have a card showing your total revenue. Now, try adding a slicer for the product category. When you select a category, watch how the Total Revenue value on your card updates instantly. That's the power of a dynamic measure.

Practical Examples of Common Measures

Once you've mastered the basics, you can start building more complex calculations. It's common for measures to reference other measures, allowing you to build up complexity in easy-to-manage steps.

1. Average Sale Value

To calculate the average sale value, you need the total revenue and the total number of sales. We already have the first part!

Step 1: Create a Total Orders measure. If you have an OrderID column, a DISTINCTCOUNT is perfect.

Total Orders = DISTINCTCOUNT(Sales[OrderID])

Step 2: Create the Average Sale Value measure. Here, it's best to use the DIVIDE function instead of the / operator to gracefully handle any potential division-by-zero errors.

Average Sale Value = DIVIDE([Total Revenue], [Total Orders])

2. Profit Margin

To calculate profit margin, you need total profit and total revenue.

Step 1: Create a Total Profit measure. Assuming you have a Profit column in your data:

Total Profit = SUM(Sales[Profit])

Step 2: Calculate the Profit Margin. Divide profit by revenue and format the measure as a percentage.

Profit Margin = DIVIDE([Total Profit], [Total Revenue])

3. Year-Over-Year Sales Growth

Time intelligence calculations are where measures truly shine. To do this, you must have a dedicated and properly configured Date Table in your model.

Step 1: Calculate the prior year's sales. The CALCULATE function lets you modify the context, and SAMEPERIODLASTYEAR tells it how.

Prior Year Sales = CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Date'[Date]))

Step 2: Calculate the year-over-year growth percentage.

YoY Sales Growth % = DIVIDE(([Total Revenue] - [Prior Year Sales]), [Prior Year Sales])

Now you have a dynamic measure that can show you sales growth for any period you select in your report.

Final Thoughts

Learning how to create measures in Power BI is a fundamental skill that transforms your reporting from static data displays into interactive and insightful analytical tools. By understanding the difference between measures and calculated columns and mastering powerful DAX functions, you can calculate the exact KPIs your business needs to make informed decisions.

Of course, becoming proficient in DAX and manually building reports can be time-consuming, especially when your data is spread across different platforms. At Graphed, we’ve made it our mission to simplify this entire process. Instead of writing formulas, you can connect your data sources in seconds and use simple natural language - just like talking to a human analyst - to instantly create real-time dashboards and get answers to your questions. If you'd rather spend your time acting on insights instead of hunting for them, give Graphed a try.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.