How to Add a Measure to a Text Box in Power BI

Cody Schneider••9 min read

Want to add a dynamic KPI summary or a narrative to your Power BI report? You might think of using multiple card visuals cramped together, but there's a much tidier solution hiding in plain sight: the text box. By embedding a DAX measure directly into a text box, you can turn a static label into a dynamic sentence that updates automatically as your data changes. This article will walk you through exactly how to do it, from the simple point-and-click method to more advanced techniques for custom narratives.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

The Power of Dynamic Text: Why Add a Measure to a Text Box?

Dashboards are more than just a collection of charts and numbers, they tell a story about business performance. While visuals are great for showing trends and comparisons, sometimes you need plain text to summarize the key takeaways. Using a hard-coded, static text box with phrases like "Sales are strong" becomes outdated the moment the underlying data changes.

This is where dynamic text comes in. Instead of a static label, you can create a title or a sentence that pulls live values from your data model. This approach transforms your report from a static document into a living, breathing dashboard.

Here are a few key benefits:

  • Create Rich Narratives: Build clear summary sentences like, "For the month, we generated $541,290 in revenue from 1,234 transactions." This provides immediate context that a simple KPI card can't offer alone.
  • Reduce Clutter: Instead of using three separate card visuals to show Revenue, Transactions, and Average Order Value, you can combine them into one fluid, readable text block. This cleans up your report canvas and directs user attention more effectively.
  • Improve User Experience: Placing a concise, dynamic summary at the top of your report gives stakeholders the most important information at a glance. They can understand the bottom line without having to interpret multiple charts, which is perfect for busy executives.
  • Add Contextual Titles: You can create dynamic titles for your charts or report pages. For example, a page title could automatically update to "Sales Performance for October 2024," pulling the selected month from a filter.

Before You Begin: Create or Identify Your Measure

Before you can add a dynamic value to a text box, you need the value itself. In Power BI, these calculations are handled by DAX (Data Analysis Expressions) measures. A measure is a formula that is calculated on the fly based on the context of your report - like filters, slicers, or interactions on other visuals.

If you already have a measure you want to use, you're all set. But if you're new to DAX or just need a refresher, creating a basic measure is straightforward.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Example: Creating a 'Total Sales' Measure

Let's say we have a sales table and we want to create a measure that sums up all the sales amounts. This is one of the simplest and most common measures you can create.

  1. From the report view, right-click on the table in the 'Data' pane that contains your sales data (e.g., 'Sales').
  2. Select 'New measure'.
  3. The formula bar will appear at the top. Type the following DAX formula:

Total Sales = SUM('Sales'[SalesAmount])

In this formula:

  • Total Sales is the name you're giving the measure.
  • SUM() is the DAX function that adds up a column of numbers.
  • 'Sales'[SalesAmount] tells the function which column in which table to sum up.

Press Enter to save your new measure. You will now see it in the 'Data' pane, usually marked with a calculator icon.

Formatting Your Measure For Display

Before you even place the measure in a text box, it's a good practice to format it correctly. If you're displaying a currency, you want it to appear with a dollar sign and appropriate decimal places. You handle this in the measure's settings, not the text box itself.

  1. Select the measure you just created (e.g., 'Total Sales') in the 'Data' pane.
  2. A new ribbon tab called 'Measure tools' will appear at the top of the Power BI window.
  3. In the 'Formatting' section of the ribbon, you can set the data type and format.
  4. Click the dropdown that says 'General' and select 'Currency'. You can also click the $ symbol.
  5. You can also adjust the number of decimal places here as needed. For our example, let's keep it at two.

Setting the format at the measure level ensures that wherever you use 'Total Sales' - in a card, a table, a chart tooltip, or a text box - it will always appear correctly formatted, providing consistency across your entire report.

Step-by-Step: Adding Your Measure to a Power BI Text Box

Power BI has made this process incredibly simple with a feature called "Smart Narratives," which includes the ability to add dynamic values to text boxes. Here's how to do it step-by-step.

Step 1: Insert a Text Box

First, navigate to the page where you'd like to add your dynamic summary. On the top ribbon, go to the 'Insert' tab and click on the 'Text box' icon. A new, empty text box will appear on your report canvas. You can drag and resize it as you see fit.

Step 2: Write Your Static Text

Click inside the new text box and type the part of your sentence that will remain static. This provides the context for your dynamic number. For this example, let's type:

This quarter's total revenue is:

Leave a space after the colon where your measure value will eventually go.

Step 3: Add the Dynamic 'Value'

This is where the magic happens. With the text box selected, you'll notice a formatting pane appears where you can configure its appearance. The easiest way to add a dynamic value is using the '+ Value' button that now appears directly in the text formatting options.

  1. With your cursor positioned in the text box where you want the number to appear, click the '+ Value' button. You can find it either in the formatting pane or on the quick-formatting bar that pops up over the text box.
  2. A 'What value would you like?' window will pop up. In this window, you can search for or navigate to the measure you created earlier. Find 'Total Sales' and select it.
  3. Click 'Save'.

You'll now see your measure added into the text box, appearing as a formatted, underlined value. It's fully dynamic. If you change a filter on your report, like selecting a specific product category or region, the 'Total Sales' value inside the text box will update instantly.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Step 4: Style and Customize Your Text and Value

Once the measure is added, you can style the text box however you like. You can change font sizes, colors, and the background of the box. Notice that you can't format the number directly inside the text box - you can't make it bold without making the surrounding text bold, for instance. Its appearance (Currency, percentages, decimals) is controlled by the measure's own formatting settings that we configured earlier.

Next-Level Dynamic Text: Tips and Advanced Tricks

The basic method is fantastic for quick KPIs, but you can achieve far more control and sophistication using DAX itself to build your dynamic strings. This unlocks the ability to mix multiple measures and apply conditional formatting directly within your sentence.

Combining Multiple Measures in One Text Box

You aren't limited to a single dynamic value. Just repeat the 'Add Value' process to embed multiple measures in one text box. For example:

*This quarter we sold [Total Quantity] units for a total profit of [Total Profit].*

Just click in the right spot, press '+ Value', and select your measure for each placeholder.

The DAX Technique: Building a Fully Dynamic Text Measure

For ultimate control, you bypass the text box's '+ Value' feature and instead create a single DAX measure that returns text instead of a number. This measure builds the entire dynamic sentence. This technique is especially useful if you need to control the formatting of the numbers more precisely or include logic.

Let's create a DAX measure that generates our summary line:

Statement of Sales = "This quarter, total revenue was " & FORMAT([Total Sales], "$#,##0") & "."

Let's break that down:

  • The components are wrapped in double quotes " " to signify a text string.
  • The ampersand & is used to concatenate (join) them together.
  • The FORMAT() function is extremely powerful. Here, it takes our [Total Sales] measure and formats it as a currency string with a dollar sign and a thousand-separator comma.

Create this new measure, and then add it to your report using a Card visual. This method puts all the logic inside a single measure, making it highly portable and easy to manage.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Adding Conditional Logic

The real power of the DAX text measure approach is embedding conditional logic. You can have the text automatically change based on performance against a target.

Imagine your sales target is $500,000 for the quarter. We can use an IF statement to change the narrative:

Performance Narrative = VAR SalesAmount = [Total Sales] VAR SalesTarget = 500000 RETURN IF( SalesAmount > SalesTarget, "Performance is excellent! Sales reached " & FORMAT(SalesAmount, "$#,##0") & ", exceeding our target.", "Performance is below target. Sales reached " & FORMAT(SalesAmount, "$#,##0") & ", missing our goal of " & FORMAT(SalesTarget, "$#,##0") & "." )

This single measure, when placed in a card visual, provides a clear, at-a-glance status update that is impossible with a standard numeric visual. It tells the viewer not just "what" the number is, but "what it means."

Final Thoughts

Adding dynamic measures to text boxes in Power BI is a simple technique that dramatically improves the clarity and narrative power of your reports. You can either use the straightforward '+ Value' feature for quickly embedding KPIs into text or create more complex, conditionally-aware summaries using a DAX measure that returns a text string itself. Both methods help elevate your dashboards from simple collections of data points to compelling, insightful stories.

If you find yourself spending a lot of time configuring BI tools like Power BI or manually pulling reports across different systems, the process can feel overwhelming. At Graphed, we've built a solution that streamlines the entire workflow. Instead of clicking through menus or writing DAX code, you can connect your data sources and create live dashboards simply by describing what you want to see in plain English. We turn hours of data wrangling into a matter of seconds, so you can focus on making decisions, not building reports.

Related Articles