Sparklines in Power BI tables and matrices

How to add sparklines to a table or matrix in Power BI, which measure and axis they take, line or column, markers for highest and last, the limits of five sparklines and 52 points, and how calculation groups affect them.

Short answer: a sparkline is a tiny line or column chart inside a cell of a table or matrix, one per row. Add it from the measure in the Values well: the arrow next to the measure, Add a sparkline, then pick the measure (Y-axis) and the field that runs along it (X-axis, usually months). A visual can hold up to five sparklines, each with up to 52 points, and a matrix with sparklines is limited to 25 columns.

A table of 40 products with this year's revenue says who sells most. It does not say who is growing and who is fading. A sparkline per row adds the shape of the last twelve months without a second visual.

What does a table with sparklines look like?

ProductRevenue 2026Last 12 monthsTrend
Mountain-2001,250 Krising, highest in Decemberup
Road-150980 Kflat, dip in Augustflat
Touring-1000760 Kfalling since Marchdown
Sport-100 Helmet220 Krising after a slow springup
Products with their revenue and the monthly trend, as the table shows them

The trend column is the sparkline in Power BI; here is the shape of the first row drawn out:

050100150200JFMAMJJASOND
The Mountain-200 sparkline, drawn large: twelve monthly points

How do you add one?

  1. Build a table or matrix with the rows you want (for example Product[Product]) and a measure such as [Revenue].
  2. In the Values well, select the arrow next to the measure and Add a sparkline.
  3. In the dialog: Y-axis is the measure and its summarisation, X-axis the field along the line, for example Date[Month]. Select Create.
  4. The sparkline appears as its own column. To change it, open the arrow next to it in the Values well and Edit sparkline.

The X-axis field decides the points: months of the selected year give 12 points; days of a quarter give about 90, and Power BI shows only 52 of them. Use weeks or months.

How do you format it?

In Format visual, the Sparklines card:

  • Chart type: line or column.
  • Line: colour and width.
  • Markers: show markers for the highest, lowest, first and last value, with size, colour and shape. A red marker on the lowest point and a green one on the last tells most of the story.

A sparkline is drawn per row on its own scale, from its own minimum to maximum. That makes the shape readable in every row and the heights incomparable between rows: a flat line on a small product and a flat line on a big one look the same.

What DAX feeds a sparkline?

Any measure, evaluated for each X-axis point within the row. A measure that is blank for future months keeps the line from dropping to zero:

Revenue = SUM ( Sales[Amount] )

Revenue to Date =
IF ( MAX ( 'Date'[Date] ) <= TODAY (), [Revenue] )

A rate works the same way: Margin % as a sparkline shows each product's margin by month. The table's main column and the sparkline can use different measures: the total for this year in the cell, the monthly trend of the last twelve months beside it.

Sparklines and calculation groups meet in one setting: apply the calculation item to Individual values (the default: each point is calculated with the item) or to the Entire sparkline (the item applies to the sparkline as a whole). Calculation items that do arithmetic are not supported in the Entire sparkline mode and show an error; switch to Individual values.

What are the limits?

Microsoft lists them:

  • Up to five sparklines per visual, and up to 52 points per sparkline.
  • A matrix with sparklines shows at most 25 columns.
  • Supported on Azure Analysis Services, not on on-premises SQL Server Analysis Services.
  • A visual with sparklines cannot be pinned to a dashboard.

What goes wrong?

  • Comparing heights between rows. Each sparkline has its own scale. Compare shapes, not heights; put the number in the cell next to it.
  • Too many points. Daily dates get cut at 52 points; use weeks or months.
  • Zero for the future. A measure returning 0 for months to come makes every line crash at the end.
  • A sparkline with no number. Without the value in the next column, nobody knows if the trend is about 2 or 2 million.

Where can you check this?

Where do you start?

Add one line sparkline by month next to the main measure, with markers on the highest and last point. The matrix visual and table visual posts cover the rest of the grid, and line charts cover the big version.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.