Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All, I’m trying to create a sparkline in a matrix visual that already has a legend. When I add a sparkline for the metric, it creates an extra column for each year-month instead of a single sparkline column. I’d like to have just one column for the sparkline. Could you please advise how to achieve this?
Actual:
Expected:
Solved! Go to Solution.
Hi @PrakashPalle ,
If the issue still persists, we kindly request you to share the sample data in a workable format such as text, an Excel file, or a PBIX file with sample data instead of screenshots. Additionally, please include the expected output. This will enable us to assist you more effectively.
Best regards.
Hi @PrakashPalle ,
If possible, could you please provide more details about your data?
How to provide sample data in the Power BI Forum
You can refer the following link to upload the file to the community.
How to upload PBI in Community
Thank you.
You still need to change the DATA Category
I converted the data category. Still the same.
could you share your pbix-file?
In Power BI, the behavior you’re seeing happens because the sparkline feature in a matrix is tied to the column hierarchy—each field in Columns (like yr_mon2) generates its own sparkline column.
If you already have a legend or multiple measures, Power BI treats every combination of measure × column field as a separate sparkline slot.
To show only one sparkline column per metric, you have two solid options:
Instead of plotting [Actual] per yr_mon2 column directly, create one trend measure that summarizes across the months in scope.
Actual Sparkline :=
VAR TrendTable =
ADDCOLUMNS (
VALUES ( 'DateTable'[yr_mon2] ),
"@Actual", [Actual]
)
RETURN
SUMMARIZE ( TrendTable, 'DateTable'[yr_mon2], "@Actual", [Actual] )
Then use Actual Sparkline as the sparkline field while keeping only one “Sum of Actual” column in your matrix.
Remove yr_mon2 from the Columns well so you don’t create repeated groups—Power BI will still draw the line by month behind the scenes.
yr_mon2 to the sparkline setup instead of ColumnsKeep only your measure (Sum of Actual) in Values.
Remove yr_mon2 from Columns.
Add a sparkline to Sum of Actual → set the X-axis field to yr_mon2.
Now the matrix shows one “Sum of Actual” column and one sparkline column summarizing the trend over all months, instead of one sparkline per month.
When you also have a legend or multiple series (e.g., “Actual vs Plan”), pivot the legend to Values and use only one date field (yr_mon2) in the sparkline X-axis.
Power BI currently doesn’t support multi-series sparklines in a single cell, so the legend has to stay out of Columns.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
This happens because Power BI sparklines depend on how your matrix is grouped. When your matrix already has a legend or separate fields like Year and Month in the columns, Power BI treats each of those combinations as a unique series. That’s why it ends up drawing multiple sparkline columns instead of just one. To get a single sparkline, try removing the legend or move it to the rows section so that all data rolls up together. Another good approach is to create a combined “Year-Month” column in your data model and use that for the sparkline’s axis , this helps Power BI recognize it as one continuous timeline. You can also make sure that your measure (like Actual or Sales) is used consistently without being split by multiple fields. Once you simplify the column grouping to one field, the matrix will automatically show a single, clean sparkline column per metric. It’s just how Power BI handles grouping logic internally.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 68 | |
| 33 | |
| 32 | |
| 31 |