Change vs. previous period HTML

Big number with a ▲/▼ badge showing % change against the previous period.

How to use it in Power BI

  1. Install the HTML Content visual (by Daniel Marsh-Patrick) from AppSource: under “Get more visuals”, search for “HTML Content”.
  2. In Power BI Desktop, create a New measure and paste the DAX code from the generator.
  3. Replace the bracketed names with the measures and columns from your model, if you have not done so in the form.
  4. Add the HTML Content visual to the page and drag the measure into the Values field.

FAQ

Does it work in the Power BI Service?

Yes. The HTML Content visual renders the measure in Desktop and in published reports.

Why do width numbers use "en-US"?

CSS and SVG require a dot as the decimal separator. Forcing the culture in FORMAT prevents models in other locales from emitting “12,5%” and breaking the layout.

Does the measure respect filters and slicers?

Yes. It is a regular DAX measure: whatever filters the source measures filters the generated HTML.

Can I restyle it later?

Yes. The HTML is plain text inside the measure; edit colors, sizes and fonts in the DAX or generate it again here.

Other generators

Revenue
$1,284,500.00
▲ 107.0% of target
KPI card with targetCard with value, % of target, arrow and progress bar — color flips automatically when the target is hit.
Monthly goal73.0%
Progress barHorizontal actual vs. target bar with label and percentage.
New York482,000
Chicago431,500
Austin298,700
Seattle214,300
Denver187,900
Top N ranking with barsTop N list of a category with proportional bars and values, in a single measure.
CityActual% Target
New York482,000107.1%
Chicago431,50093.8%
Austin298,700106.7%
Seattle214,30082.4%
Denver187,900104.4%
Miami152,40076.2%
HTML table with statusTable with category, actual, % of target and a green/red dot per row.
78,000
SVG sparklineMini SVG line chart with the latest value next to it — great inside cards.
82%of target
Donut gaugeSVG donut that fills according to % of target, with the number in the center.
At risk · 86.0%
Traffic-light statusThree-band pill (green, yellow, red) driven by % of target.