- Podcasts
- Microsoft Power BI Data Analyst Certification PrepCast
- Creating Visual Calculations with DAX
Creating Visual Calculations with DAX
Microsoft Power BI Data Analyst Certification PrepCast
- November 17, 2026
- 16 min
- Season 1, episode 62
About this episodeThis episode focuses on a practical PL-300 objective: Creating Visual Calculations with DAX. Visual calculations use DAX for results that…
Transcript
From the publisherThis transcript comes from the podcast’s own feed, as the publisher wrote it. It has no timestamps.
Creating Visual Calculations with DAX
A sales director asks for a chart that shows monthly sales and a running total. The running total is needed only on that chart. It doesn’t need to appear in other reports, and nobody has asked for it as a centrally managed business metric. You could still create a measure in the semantic model, but should you? What evidence would show that your choice fits the requirement rather than merely producing plausible numbers?
That decision is part of the PL-300 skill to create visual calculations by using DAX. The important word is visual. A visual calculation is stored on an individual visual and evaluates the aggregated data available to that visual. It doesn’t become a reusable measure in the semantic model. This makes it a strong candidate for calculations such as a running sum, moving average, or period comparison when the result is genuinely local to one visual.
For a running sum, it can accumulate the first displayed monthly total, then the first two, then the first three, continuing across the data available to the visual. It isn’t being described here as a new column added to every underlying sales transaction. It’s calculating over the summarized result represented by the visual.
Now imagine that operations asks for a moving average on a second visual, while finance wants the same definition on several report pages. The requirement is no longer narrowly local. If those consumers need one reusable or centrally governed definition, a model measure is the better choice. If the moving average is a presentation-specific calculation that belongs only to one visual, a visual calculation may fit.
This also corrects a tempting misconception. If Power BI exposes a feature, that doesn’t make the feature appropriate for every report. An available visual calculation isn’t automatically better than a measure, and a familiar model measure isn’t automatically better than a visual calculation. The analyst has to ask where the logic belongs, what data it evaluates, who needs to reuse it, and how its correctness will be maintained.
Return to the monthly sales chart. Assume it displays monthly sales totals of ten thousand, fifteen thousand, and twelve thousand for the first three months. A running sum over those visible aggregates should produce ten thousand for the first month, twenty-five thousand for the second, and thirty-seven thousand for the third.
Filter context also matters to your interpretation. Filter context is the set of filters affecting the data evaluated for a report visual or DAX expression. If the report is limited to one region, product group, or year, the aggregated values available to the visual may represent that selection rather than the entire dataset. The running sum or moving average must therefore be checked against the values presented under the filter condition you’re testing. A correct result for all regions doesn’t prove that the result remains meaningful under every consumer selection.
Suppose the normal view contains sales for all regions and the running sum looks reasonable. A user selects the North region, and the cumulative values no longer match what the analyst expected. Don’t begin by changing an unrelated Power Query transformation or redesigning the entire model. First reproduce the exact condition. Record the selected region, the monthly base values shown by the visual, the cumulative values actually produced, and the values that should result from those displayed aggregates.
That comparison helps isolate the layer responsible for the symptom. If the monthly sales values themselves are wrong, the issue may lie before the visual calculation, and the local running sum could simply be accumulating incorrect inputs. If the monthly values are correct but the cumulative output is wrong, attention should stay on the DAX result and the context in which the visual calculation evaluates. The calculation’s presence proves only that it was configured. It doesn’t prove that the logic or interpretation is correct.
After a correction, retest the ordinary view and the filtered view. The original all-region case confirms that you haven’t broken the behavior that appeared to work before. The North-region case confirms that you’ve addressed the reported failure. This two-part check matters because a change that fixes one condition can still leave a different condition incorrect. Observable output, not a successful edit, is the evidence that the requirement has been met.
A moving average creates a similar verification need. Imagine a visual that presents monthly sales and a smoothed result intended to help a manager see the broader direction. The label moving average sounds familiar, but familiarity doesn’t define the business requirement. You still need to know which aggregated values the result is meant to consider and then compare the visible output with a small set of values you can calculate independently. If the report is filtered, repeat the comparison in that state rather than assuming the unfiltered check covers it.
If a local calculation is mistaken for a governed metric, two visuals may be treated as though they share one definition when they don’t. If a reusable model measure is created for logic that was only a temporary visual need, the model may take on a business definition that nobody actually requested. Matching the layer to the requirement keeps the technical design aligned with the meaning presented to the consumer.
Consider two report pages maintained by different analysts. One page needs a running sales total for a particular chart. The other page may eventually need a cumulative value too, but its owner hasn’t established that the definition should be identical. Creating a local visual calculation on the first chart satisfies the current local requirement without claiming that a centrally governed cumulative metric now exists. If the organization later decides that both pages must use one shared definition, that’s evidence for moving the logic into a reusable model measure.
The reverse mistake is also possible. An analyst may create a visual calculation because it’s quick to place near the displayed result, then discover that several other visuals need the same logic. Copying the idea from visual to visual doesn’t turn those local calculations into one governed object. The requirement has changed from local presentation logic to reusable model logic. At that point, preserving the calculation as a model measure is the more appropriate design because reuse and central governance now matter.
Compare the visual calculation’s output with the expected DAX result. Correct the setting or logic that directly governs the behavior, and retest both the ordinary and failing conditions. Randomly editing transformations, relationships, other visuals, or service settings can make the report harder to understand without addressing the local calculation at all.
This is why memorizing an interface path is weak preparation for an applied decision. An interface can tell you where an option appears, but it can’t decide whether the business needs local visual logic or a reusable semantic-model measure. It also can’t tell you whether a result is correct merely because the formula was accepted. You need to understand the mechanism, predict the output, and observe what the consumer receives.
The sales director’s original request can now be evaluated cleanly. Monthly sales are already aggregated in the chart. The running total is needed only there, so a visual calculation fits the stated scope. The analyst checks a few known monthly totals, verifies the cumulative results, applies a relevant filter, and repeats the comparison. If the business later asks for the same governed running total elsewhere, the design should be reconsidered rather than treating the first local choice as permanent.
That pattern carries into more complicated Power BI work. Restate the outcome, identify the layer that owns the behavior, apply the mechanism documented for that layer, and validate the result where users experience it. For visual calculations, that means remembering both halves of the feature. They operate over the aggregated data available to a visual, and they remain stored on that visual rather than becoming reusable model measures.
A visual calculation is more than DAX placed near a chart. Its location explains its purpose. It’s stored on the visual, evaluates the aggregated data available there, and works best when the logic is genuinely local. When a calculation must be reused or governed centrally, a model measure is the better architectural choice.
Whichever layer you choose, don’t accept a plausible result as proof. Establish the expected output from known aggregated values, reproduce relevant filter conditions, and compare what the consumer sees with what the calculation should produce. That combination of layer selection, mechanism, and observable verification turns a working configuration into a defensible Power BI solution.
Explain why a visual calculation belongs at the visual layer rather than in the semantic model. Which change in visual structure or filter state would expose that scope? The episode reference preserves the non-narrated details needed for practice and later recall. This lesson was produced by Bare Metal Cyber dot com.
