Sub topic 1
Reports: the data behind every dashboard
A Salesforce dashboard does not query data by itself. Each component reads from a source report, and the dashboard only draws what that report returns. If you understand reports well, most dashboard behavior becomes predictable. This includes why a component is empty, why a number differs from a colleague's, and why a chart cannot show a second grouping.
This chapter covers the working model: how a component relates to its report, which report formats a dashboard can use, how filters and sharing flow through, and the errors people hit most often.
Prerequisites
This chapter assumes you have the following:
- Basic navigation in Lightning Experience, including the App Launcher and the Reports tab.
- Familiarity with standard objects such as Accounts, Opportunities, and Cases.
- The ability to create, run, and save a basic report.
- Awareness of profiles, roles, and record sharing, because they decide which records a report returns.
You do not need to have built a dashboard yet. The next chapters cover that.
How a dashboard component uses a report
A dashboard is a container of up to 20 components. Each component points to exactly one source report. Several components can share the same report, and one report can feed many dashboards.
When a dashboard refreshes, Salesforce runs each source report as the dashboard's running user and stores the results. Viewers see those stored results, not a live query. The next chapters explain the running user in depth. For now, remember that a dashboard shows the data its source report would return for the running user, as of the last refresh.
This gives the central rule of dashboard design: fix problems in the report first. A component cannot show a field, a grouping, or a filter that the report does not provide.
Report formats and what dashboards can use
Salesforce reports come in four formats. Each has a different relationship with dashboards.
| Format | Structure | Use as a dashboard source |
|---|---|---|
| Tabular | Flat rows, no groupings | Limited. Works for table components and for charts or metrics when you set a row limit or use a total. |
| Summary | Rows grouped by one to three fields, with subtotals | Best general choice. Groupings become chart axes and slices. |
| Matrix | Groupings on both rows and columns | Good for two-dimensional charts such as stacked bars. |
| Joined | Multiple blocks from different report types | Not supported as a dashboard source. |
Summary and matrix reports are the usual choice. Their groupings give a chart something to plot: one grouping gives one series of bars or slices, and two groupings give stacked or grouped series.
Tabular reports have no groupings. A chart built on one must use a row limit, and the result is a "top N" style chart.
If you must use a joined report's data, rebuild it as a summary or matrix report from a single report type, or build separate reports and put each on the dashboard.
The pieces of a report that matter to a dashboard
Report type
The report type decides which objects and fields exist. If a field is missing from a component's "Y-axis" choices, the report type often does not expose it. Changing the report type later is awkward, so pick it deliberately. For example, "Opportunities" returns only opportunities, while "Opportunities with Products" returns one row per opportunity product, which can inflate amount totals.
Filters
Filters decide which records are in scope. A report has three layers:
- Show Me is the record scope, such as My opportunities, My team's opportunities, or All opportunities.
- Standard filters, such as date range and the "Opportunity Status" picklist, are set in the filter pane.
- Field filters are conditions you add on any field, and you can combine them with filter logic.
Dashboard filters, covered in a later chapter, are applied on top of these report filters. A dashboard filter never widens the scope. It can only narrow what the report already returns.
Groupings and summary fields
Groupings split the rows. Summary fields (sum, average, min, max, record count) are the values calculated for each group. A chart's value axis uses one of these summaries. If you want "total amount by stage", the report needs an Amount summary and a Stage grouping.
Bucket fields and custom summary formulas
A bucket field groups values into categories without changing the data, for example "Small, Medium, Large" deals by amount. A custom summary formula adds a calculated value, such as win rate. Both are defined in the report and appear in dashboard components as ordinary groupings or measures.
A worked example in SOQL
A summary report is similar to a SQL GROUP BY query. Salesforce's query language, SOQL, can express the same grouping.
Suppose a summary report is built on Opportunities, filtered to open opportunities, grouped by Stage, with a sum of Amount. The equivalent SOQL is:
SELECT StageName, SUM(Amount) total
FROM Opportunity
WHERE IsClosed = false
GROUP BY StageNameReading it against the report:
WHERE IsClosed = falsecorresponds to the report filter for open opportunities.GROUP BY StageNamecorresponds to the Stage grouping.SUM(Amount)corresponds to the summary field.
This is a good test of whether a report is suitable for a dashboard. If you can describe it as "measure by one or two groupings, with a filter", a chart can display it.
Two caveats apply. A report and a SOQL query can return different results if they use different record scope or sharing context. SOQL also does not replicate every report feature, such as bucket fields and cross filters.
Visibility: whose records does the report return?
A report returns the records the running user is allowed to see. Sharing rules, role hierarchy, and profile object permissions all apply. So two people running the same report can get different totals.
For dashboards this has two consequences:
- In a standard dashboard, one named user is the running user. Every viewer sees what that person's access allows, even if the viewer could not see those records on their own.
- In a dynamic dashboard, each viewer's own access applies.
Both options are covered in later chapters.
Viewing a dashboard and opening its source report are separate permissions. A viewer who can open a dashboard folder can see the component results. To click a component and open the underlying report, the viewer also needs access to the report's folder. When they lack it, the click-through fails, but the dashboard still renders.
Report design guidelines for dashboards
- Name reports for their purpose. A name like "Open Pipeline by Stage (Dashboard)" tells later editors that changes may affect a dashboard.
- Keep reports narrow. Filter early. A report that returns hundreds of thousands of rows is slow to refresh and can hit row limits.
- Pick one clear grouping. A chart with three groupings is hard to read. Components generally use the first one or two.
- Use relative date filters. "Current FY" or "Last 30 Days" keeps the dashboard current. A fixed date range goes stale.
- Put dashboard source reports in a dedicated folder. This makes it clear which reports are safe to change.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Component says "No data" | The report returns zero rows for the running user, or a filter is too strict | Run the report as the running user, or loosen the filters |
| The needed field is not listed for the axis | Report type does not expose it, or no summary exists for it | Add a summary field in the report, or change the report type |
| Totals are higher than expected | A report type that returns one row per child record, such as products | Use a report type with one row per parent, or use a distinct count |
| Chart shows only a few bars | A tabular report with a row limit, or the chart's "maximum groups" setting | Use a summary report or raise the limit |
| Source report cannot be chosen | The report is a joined report, or you lack access to its folder | Rebuild the report in a supported format, or get folder access |
| Numbers differ from the same report run by you | Different running user, so different record access | Compare as the running user |
Editing a report that a dashboard uses
Changing a source report changes every component that uses it. When you add a grouping, rename a summary field, or change a filter, a chart's axis may break or the numbers may shift. Before changing a report:
- Open the report's folder and note which dashboards use it. In Lightning Experience, a dashboard component shows its source report name, and the report's "Dashboards" related information can help you find dependents.
- Make the change on a clone of the report first.
- Point one test component at the clone and check the result.
- Update the original only after the result is correct, then refresh the dashboard.
Summary
- Every dashboard component reads from exactly one source report. The dashboard cannot show anything the report does not return.
- Summary and matrix reports are the best sources, because their groupings give charts axes and series. Joined reports cannot be used.
- The report type, the filters, the groupings, and the summary fields all shape what a component can display.
- A report returns records based on the running user's access, so the same report can show different totals to different users.
- Changing a shared source report affects every dashboard that uses it, so test on a clone first.
Exercise
A dashboard chart shows total Opportunity Amount by Stage. A colleague runs the source report and sees larger totals than the chart shows. The report is the same one. Give two possible causes and say how you would check each.
Show answer
First, the dashboard's running user may have narrower record access than the colleague, so the chart omits records the colleague can see. Check by running the report as the running user, or by comparing the running user's role and sharing access with the colleague's. Second, the dashboard may be showing stale results because it has not been refreshed since records changed. Check the "as of" refresh time on the dashboard and refresh it. A third possibility is that a dashboard filter is narrowing the data, which you can check by clearing the dashboard filters.
Exercise
You need a dashboard chart that shows Case count by Priority and by Status together. Which report format should you choose, and why is a tabular report a poor choice?
Show answer
Use a summary report grouped by Priority and Status (or a matrix report with Priority on rows and Status on columns). A chart needs groupings to plot, and a stacked or grouped chart needs two of them. A tabular report has no groupings, so it can only give a flat list or a limited "top N" view.