Sub topic 13
Charts and Dashboards from Each Format
This chapter assumes you can already build tabular, summary, matrix, and joined reports in Lightning Experience. It also assumes you know what groupings and summary fields are. Here you will learn how each format feeds a chart, how a chart becomes a dashboard component, and where each format stops working.
How a chart relates to its report
A report chart is a visual layer on top of one report. The chart reads the report's groupings and summary values. It does not run its own query. If you change the report's filters, the chart changes with them.
A dashboard component is different from a report chart. A component points to a source report and shows one chart, table, gauge, metric, or similar visual built from that report's results. Several components can use the same report. Each component can choose its own display settings.
This leads to a rule that explains most of the limits in this chapter. A chart needs a value to plot (a summary) and at least one grouping to place that value on an axis. A format that lacks either of these cannot drive a chart directly.
Tabular reports
A tabular report has no groupings. It can show a grand total, but it has no axis to plot against. Because of that, a tabular report cannot be charted in the usual way.
There is one common exception. A dashboard table or a list-style component can show the top rows of a tabular report. Use this when you want a "top 10 largest opportunities" list. The report must be sorted and limited, because the component shows only a small number of rows.
Tabular reports are best on dashboards when the reader needs to see individual records. They are poor when the reader needs to compare totals.
Summary reports
A summary report has one or more row groupings, so it fits charts well. The grouping becomes the category axis, and the summary field becomes the value axis.
Common chart types for a summary report:
- Vertical or horizontal bar charts, for comparing groups such as Stage.
- Line charts, for a date grouping such as Close Month.
- Donut, pie, and funnel charts, for parts of a whole or stage progression.
- Scatter charts, for relating two summary values.
- Metric and gauge components, for a single number.
Multiple groupings in a summary report
A summary report can have up to three row groupings. A chart can use these groupings in different ways, depending on the chart type. A stacked bar chart, for example, uses the first grouping for the bars and the second for the stack segments. Keep the number of segments small. A stack with fifteen colors is unreadable.
Choosing the summary value
If the report has several summary fields, the chart or component must pick which one to plot. A common mistake is to add the record count and the sum of Amount, then build a chart without checking which one it uses. Always confirm the axis label.
Matrix reports
A matrix report groups by both rows and columns. This gives a chart two dimensions to plot.
- A clustered bar chart puts the row groups on the category axis and uses the column groups as separate bars within each cluster.
- A stacked bar chart stacks the column groups.
- A stacked 100% chart shows each column group's share of the whole.
For example, a matrix with Stage as rows and Close Year as columns gives a bar for each stage, with one segment per year. This is the same data the SOQL query with two GROUP BY fields would return.
Matrix limits in charts
Matrix reports have the most restrictions for charts.
- Pie, donut, and funnel charts show a single dimension. A matrix report with both groupings cannot fill them in a meaningful way, so you must drop to one grouping, or use a summary report instead.
- Heavy groupings produce crowded charts. A matrix with 12 row values and 6 column values yields 72 cells, which is too many for one chart.
- Rows and columns are limited in what they display. Components cut off long lists, and the remainder may be hidden or combined.
If you need a chart from a matrix, reduce the groupings with a filter, or use a bucket field to merge small groups into a few categories.
Joined reports
A joined report combines up to five blocks. Each block can use a different report type. Joined reports have the weakest chart support of the four formats.
What you can do:
- Build a chart on a joined report. The chart can plot a summary from a block, and you can plot a cross-block summary formula.
- Use common groupings to compare blocks on a shared axis. For example, group Opportunities and Cases by Account Owner to compare them side by side.
What you cannot do:
- Add a joined report as the source of a dashboard component in the usual way. Dashboard components support joined reports only in a limited way. Check your org's release for the current behavior before planning a dashboard around one.
- Use a joined report with features that need a single report type, such as some filter and subscription behaviors.
Because of these limits, a common pattern is to build the joined report for analysis, then build separate summary reports for the dashboard. Each component then reads one summary report. This also makes the dashboard faster to load.
Comparing the formats
| Format | Chart support | Typical dashboard use | Main limit |
|---|---|---|---|
| Tabular | None, except list-style components | Top N lists | No groupings or axis |
| Summary | Bar, line, donut, funnel, scatter, metric, gauge | Totals by one dimension | Up to three groupings |
| Matrix | Clustered and stacked bar, stacked 100% | Comparison across two dimensions | Single-dimension chart types do not apply |
| Joined | Limited, per block and common grouping | Analysis outside the dashboard | Weak dashboard support |
Building a chart and adding it to a dashboard
Follow these steps for a summary report grouped by Stage.
- Open the report in the report builder.
- Choose Add Chart.
- Select a chart type. Pick a bar chart for stage comparison.
- Check that the value axis uses the Sum of Amount, not the record count.
- Save the report. The chart is saved with it.
- Create or open a dashboard, choose Add Component, and select the source report.
- Choose a component type and confirm the groupings and value shown.
The component keeps its own display settings. You can change its title, axis range, and sort order without changing the report.
Dashboard filters
A dashboard filter applies one field to many components. Each component's source report must contain the field, or the filter has no effect on that component. If a filter appears to do nothing, check that the source report includes the field you are filtering.
Common errors
- Chart does not appear. The report has no grouping, or it is a tabular report. Add a row grouping.
- Wrong numbers on the axis. The chart picked a different summary than the one you intended. Edit the component and select the right value.
- Dashboard shows stale numbers. Dashboards show data as of the last refresh. Refresh the dashboard, or set a schedule.
- Viewer sees different data than you. The dashboard runs as a specific user, or as the viewer, depending on your settings. Row visibility follows that user's access.
- Component hides groups. Large groupings are truncated. Filter the report or bucket values.
Relating to SOQL
A chart from a summary report plots the same numbers as this aggregate query:
SELECT StageName, SUM(Amount) total, COUNT(Id) cnt
FROM Opportunity
GROUP BY StageNameA clustered chart from a matrix report matches the two-dimension version:
SELECT StageName, CALENDAR_YEAR(CloseDate) yr, SUM(Amount) total
FROM Opportunity
GROUP BY StageName, CALENDAR_YEAR(CloseDate)The chart is a picture of these grouped results. If the chart looks wrong, check the grouping and the summary first, since those define the result.
Exercise
A sales manager wants a dashboard component that compares Opportunity amount by Stage, split by Close Year. Which report format should be the source, and which chart type fits best? Name one limit to watch for.
Show answer
Use a matrix report with Stage as rows and Close Year as columns, and a clustered or stacked bar chart. Watch for too many row or column values, which make the chart crowded. A pie or donut chart does not fit because it shows only one dimension.
Exercise
You built a joined report that compares Opportunities and Cases by Account Owner. You need to show the result on a dashboard. What approach is the safest?
Show answer
Build a separate summary report for each block, with the same grouping, and use one dashboard component for each report. This avoids relying on a joined report as a component source.