How to Create Charts with Copilot in Fabric: Step by Step
Turning a table full of numbers into a clear chart is often the missing step that helps a team understand what the data is actually saying. With Copilot in Fabric, you can describe the chart you want in plain language, inside a Notebook, and get ready-to-run code — without memorising matplotlib syntax or hunting for old examples. This guide shows, step by step, how to create charts with Copilot in Fabric from a table in your Lakehouse — an approach that is ideal for exploring data quickly before building a full report.
Prerequisites
- A Fabric workspace on a paid capacity (F2 or higher) or on a trial capacity.
- Copilot enabled by your administrator in the tenant settings.
- A Notebook attached to a Lakehouse with at least one data table.
- Basic knowledge of Notebooks and Python.
Step 1: Load the data into a DataFrame
Before drawing the chart, you need the data in a variable. Open the Notebook, attach it to the Lakehouse and run a cell that aggregates the table into a DataFrame. In the example, we sum the sales amount by region:
df = spark.sql(
"SELECT region, SUM(amount) AS total "
"FROM sales GROUP BY region"
)
display(df)
Check that display shows the region and total columns. This df DataFrame is what Copilot will use as its basis.
Step 2: Open Copilot in the Notebook
On the Notebook toolbar, click the Copilot icon to open the chat pane on the right. The first time, run the cell that the pane adds automatically to load Copilot. You have two ways to work: the chat pane, ideal for multi-step requests, and in-cell Copilot, for quick improvements inside a single cell. The pane is aware of the cells you have already run, so keep Step 1 executed so that it "sees" your DataFrame.
Step 3: Ask for the chart in plain language
In the Copilot pane, write a clear request that states the chart type, the columns and the sort order. The more specific your request, the better the result — a vague request gives a generic chart. For example:
Create a bar chart of total sales by region from the DataFrame df, sorted from highest to lowest.
Copilot replies with a short explanation and a code block. Always review the code before running it: confirm that it uses the right DataFrame (df) and the correct columns.
Step 4: Run and refine the code
Insert the code into a new cell and run it. A typical result looks like this:
import matplotlib.pyplot as plt
pdf = df.toPandas().sort_values("total", ascending=False)
plt.figure(figsize=(8, 5))
plt.bar(pdf["region"], pdf["total"], color="#0078D4")
plt.title("Total sales by region")
plt.xlabel("Region")
plt.ylabel("Total")
plt.tight_layout()
plt.show()
To adjust it, ask Copilot for the change instead of rewriting everything. Requests such as "change it to a line chart" or "show the values on top of each bar" keep the previous context. If you get an error saying a column does not exist, paste the message into the pane and ask Copilot to fix the error.
Check the result
The chart appears right below the cell. Confirm three things: the axes have readable labels, the order of the bars matches what you asked for (highest to lowest) and the values match the display from Step 1. If the numbers do not add up, the problem is almost always in the DataFrame query and not in the chart — review Step 1.
Conclusion
In four steps, you went from a table to a clear chart without writing the syntax from scratch, letting Copilot handle the repetitive code. From here, try asking for interactive charts with Plotly or combining several charts into a single figure to compare metrics. With practice, you will find that describing the chart well is half the work. What is the first metric on your team that would benefit from a Copilot-generated chart?