Build and share the Franchise Performance dashboard
This dashboard reads the franchise_sales_metrics metric view, so its key performance indicator (KPI) cards and charts use the same measure definitions that you validated on the previous page. The dashboard doesn't use copied SQL or define revenue a second time. For how cached results affect what viewers see, see Keep dashboard data fresh.
Dashboards query Unity Catalog tables, views, and metric views through a SQL warehouse.
Previous page | What carries forward |
|---|---|
The governed measures and fields on |
Requirements
Confirm the following before you start:
- The
franchise_sales_metricsmetric view from Define sales metrics as a metric view. - Genie Code for dashboard authoring, which needs partner-powered AI features enabled for the account and the workspace, and a workspace in a supported region. On workspaces with the compliance security profile, Genie Code for dashboard authoring is on by default even when partner-powered AI features are off. See Partner-powered AI features and Geo availability of Genie Code features.
Build the dashboard
Create the dashboard, add the metric view as its dataset, and then have Genie Code build the widgets from the prompt below.
Create the dashboard
Click Dashboards in the sidebar, and then click Create in the upper-right corner.
Rename the dashboard
Rename the dashboard to Bakehouse Franchise Performance.
Add the metric view as a dataset
On the Data tab, click Add data, and select a Unity Catalog object. Browse to starterjourney_catalog > bakehouse_gold, and select franchise_sales_metrics. The dataset includes all of the fields and measures in the metric view. See Use metric views.
Build the widgets with Genie Code
On a new dashboard, Genie Code appears in the center of the canvas. Paste this prompt:
Build a one-page dashboard from the franchise_sales_metrics dataset. Add KPI counter cards for Total Sales, Order Count, and Avg Order Value. Add a line chart of Total Sales by Sales Date. Add a bar chart of Total Sales by Franchise and a bar chart of Total Sales by Product. Add a date range filter on Sales Date and a filter on Franchise. Lay it out cleanly on a single page.
Genie Code asks for your approval before it changes the dashboard. Select Allow for each change that matches the list above, and select Decline for any other change.
Review the widgets
Check the generated dashboard against the following list:
- Three KPI counter cards show Total Sales, Order Count, and Avg Order Value.
- A line chart shows Total Sales by Sales Date.
- Two bar charts show Total Sales by Franchise and Total Sales by Product.
- A date range filter uses Sales Date, and a filter uses Franchise.
- Every widget uses the
franchise_sales_metricsdataset.
If an item is missing or uses the wrong field, ask Genie Code to correct it, and then check the result again.
Adjust the layout
Adjust the widget titles and the layout as needed.
Publish the dashboard
Click Publish in the upper-right corner, and choose a data permission option. See Choose data permissions. After you publish, the Sharing dialog opens.
Share the dashboard
In the Sharing dialog, add the group of analysts who need the dashboard, such as data-analysts-starter-journey, with a permission level, and then click Copy link. You can also share with users who don't have access to the workspace. They must be registered with your Databricks account. See Share a dashboard.
Verify access as a viewer
Ask a member of the shared group to open the copied link, and confirm that the published dashboard loads. If you selected Individual data permissions, confirm that the viewer sees only the data that their Unity Catalog permissions allow. If access fails, see Share a dashboard.
Choose data permissions
When you publish, you choose how viewers get data:
- Share data permissions (default): Viewers run queries with the publisher's data permissions. They can see the dashboard without access to the underlying data. This can expose data to users who haven't been granted access to it.
- Individual data permissions: Viewers run queries with their own data permissions. They see only the data that their Unity Catalog permissions allow, including row filters and column masks. Viewers must have access to the underlying data. The publisher's credentials grant compute access.
With Share data permissions, viewers see data that they can't query directly. Use it only when the audience shouldn't need direct access to the tables. Use Individual data permissions when row filters or column masks must apply to each viewer.
See Share a dashboard.
Keep dashboard data fresh
Dashboards reuse cached query results that are less than 24 hours old, even when the underlying data has changed. A change to the underlying data doesn't refresh that cache, so viewers can see results that are up to 24 hours old. To refresh the cache on a regular cadence, add a schedule to the published dashboard. For dashboards that use share data permissions, scheduled updates populate a cache that all viewers share. See Manage scheduled dashboard updates and subscriptions and Dataset optimization and caching.
The dashboard and the Genie Agent share measure definitions, but they don't guarantee identical results.
Troubleshooting
Use these entries to troubleshoot the Genie Code panel and widget values.
The Genie Code panel doesn't appear
Genie Code for dashboard authoring needs partner-powered AI features enabled for the account and the workspace, and a workspace in a supported region. On workspaces with the compliance security profile, Genie Code for dashboard authoring is on by default and runs on Databricks-hosted models, even when partner-powered AI features are off. Availability depends on your compliance standard. See Partner-powered AI features and Geo availability of Genie Code features.
A widget's numbers don't match the metric view
You can't edit a dataset built from a metric view to exclude columns or add filters. Check the widget's dataset, and check for a dashboard-level filter that narrows the data. If a widget runs its own SQL query, rebind it to franchise_sales_metrics.
Next steps
-
- Create the Bakehouse Sales Assistant
- Create the Bakehouse Sales Assistant, so business users can ask questions in plain English
-
- Dashboards
- Learn about dashboard authoring, data modeling, sharing, and embedding