Project 1 · Part 4 of 4

Sales against targets: a notebook reads Excel from SharePoint

Concepts

  • Notebook: a page of cells, some with text and some with code, that you run in order. Fabric runs the code with Spark, a data-processing engine.
  • pandas: a Python library for working with tables. It can read Excel files.
  • Join: combining two tables on the columns they share, such as the store code and the month.

Hands-on exercise

Keep sales_vs_target.ipynb from Part 1 at hand.

Import the notebook

  1. Open the workspace ws-ex01-sharepoint and select Import › Notebook › From this computer.

    The workspace toolbar: Import, then Notebook, then From this computer

  2. In Import status, select Upload and choose sales_vs_target.ipynb.

    Import status panel with the Upload button highlighted

    The workspace list: the lakehouse, its SQL analytics endpoint and the notebook sales_vs_target

  3. Select sales_vs_target to open it.

    The notebook: the title cell and the parameters cell

Attach the lakehouse

The Explorer pane of the notebook reads No data sources added. The notebook cannot run until a lakehouse is added.

  1. Select Add data items › From OneLake catalog.

    No data sources added, with Add data items and From OneLake catalog highlighted

  2. Two items are named lh_sharepoint_demo. Select the box next to the one with the lakehouse icon, then select Add. The other item is the SQL analytics endpoint, which is read-only. Pointing at an icon shows the item’s type.

    OneLake catalog: the lakehouse lh_sharepoint_demo selected, above the endpoint of the same name

Run the notebook

  1. Select Run all.

    The notebook toolbar with Run all highlighted, and the lakehouse in the Explorer pane

  2. When the third cell finishes, read its output.

    The third cell and its output: Reading table dbo.monthly_sales; Targets 12 rows, stores 4 rows

  3. Read the fourth cell, which builds the result.

    The fourth cell: monthly revenue per store, join with targets, save sales_vs_target

  4. Scroll to the end of the notebook.

    Result table: 12 rows, three months for four stores, with revenue, target and percentage of target

    Store Revenue, Nov 2026 (€) Target (€) % of target
    ATH01 Athens Syntagma 33,336.52 31,200 106.8
    ATH02 Athens Kifisia 27,626.29 25,900 106.7
    HER01 Heraklion Port 21,730.80 21,100 103.0
    SKG01 Thessaloniki Centre 25,204.01 25,000 100.8

    If your figures match, every part of the project worked: the shortcut to Targets, the self-updating table, the November sync and the notebook.

Change a target in SharePoint

  1. In SharePoint, open Documents › Targets and select targets_2026.xlsx. It opens in Excel in the browser. On the sheet Targets, change cell C10, the November target of ATH01, from 31200 to 35000. Excel saves the change; close the browser tab.

    The Targets sheet in Excel, with cell C10 changed to 35000

  2. In the notebook, select Run all again and scroll to the end.

    Result table after the change: ATH01 in November with target 35000 and 95.2 per cent

Clean up

  1. Remove what the project created, so that the two-minute check stops:

    1. In the lakehouse, select … next to monthly_sales, then Delete. This stops the sync; the files in SharePoint are not affected.
    2. To remove everything in Fabric, open the workspace, select Workspace settings, then Other › Remove this workspace, and confirm with Delete.
    3. If you no longer need the site, open it in SharePoint, select Settings (the gear icon) › Site information › Delete site, select the confirmation box, and select Delete.

How the notebook works

Cell What it does
1 Title and short description.
2 Names used later: the table monthly_sales, the shortcut Targets, the file targets_2026.xlsx and the result sales_vs_target. If you named anything differently, change it here.
3 Opens Files/Targets/targets_2026.xlsx through the shortcut and reads the sheets Targets and Stores with pandas. If the path cannot be read directly, it first copies the file to the Spark session with notebookutils.fs.cp.
4 Sums revenue per store and month from monthly_sales, joins the targets and store names, calculates the percentage of target, and saves sales_vs_target.

The core of cell 3 is ordinary pandas, reading a file that lives in SharePoint:

local_path = f"/lakehouse/default/Files/{TARGETS_SHORTCUT}/{TARGETS_FILE}"
targets = pd.read_excel(local_path, sheet_name="Targets", dtype={"month": str})
stores  = pd.read_excel(local_path, sheet_name="Stores")

Fabric can also convert Excel files into tables with a shortcut transformation, but that feature is in preview. This project therefore reads the workbook with code.

Before you use it at work

The project works on a trial, but a real setup needs these points. Checked on 4 December 2026; these features change often.

Topic What to know
Status SharePoint shortcuts are documented without a preview label. CSV, Parquet and JSON transformations are generally available; Excel transformations are in preview.
What can be linked Folders only, not single files. Enterprise SharePoint sites and OneDrive for Business only: no personal or on-premises sites, no subsites, no hub sites. Point each shortcut at the most specific folder.
Who signs in In this project the connection uses your own account, so the lakehouse sees what you see. To reduce throttling, Microsoft advises a workspace identity instead. Only a workspace admin can set it up, and an administrator must give the identity the Sites.Selected permission and access to the site.
Throttling SharePoint limits heavy use and answers with HTTP 429 errors. Avoid many parallel Spark jobs with the same user account, use narrow folders, and prefer a workspace identity.
Sensitivity labels Compared only when a shortcut is created, never afterwards.
Copies and cost A Files shortcut keeps no copy. A transformation keeps a converted copy and checks the folder every two minutes using Spark compute, until it is deleted.
When it fits Business users keep working in SharePoint and Excel (targets, budgets, small reference lists), and the data team needs that data next to other data without manual exports.
When it does not Large or fast-changing data, files whose columns change often, and production loads that depend on one person’s account.
Sources and further reading
Statement Source
Notebooks can be imported from your computer as .ipynb files; adding lakehouses to a notebook How to use notebooks
pandas reads a named sheet of an Excel file pandas.read_excel
SQL analytics endpoint: read-only, same name as the lakehouse SQL analytics endpoint
Excel transformations in preview; CSV, Parquet and JSON generally available. Deleting the transformation stops the sync and leaves the source files; Spark compute; two-minute check Shortcut transformations
No preview label. Folders only; enterprise sites and OneDrive for Business; no subsites or hub sites; most specific folder. Workspace identity to reduce throttling; workspace admin; Sites.Selected; HTTP 429; parallel Spark jobs; labels compared at creation Create a OneDrive or SharePoint shortcut
Deleting inside a shortcut deletes at the target OneLake shortcuts
Workspace settings › Other › Remove this workspace › Delete Lakehouse tutorial: clean up
Settings › Site information › Delete site Delete a SharePoint site
Import › Notebook › From this computer, Upload, Imported successfully, Add data items, From OneLake catalog, the type shown when pointing at an icon, Run all, Session will start soon and its stated startup time, session ready in about ten seconds, cell outputs, figures, Excel in the browser, the changed target Observed in Fabric, 30 November and 3 December 2026
Notebook and sample data Fabwreck (fictional data)
When it fits and when not Fabwreck, based on the sources above

Further reading: Fabric Notes 17 (Lakehouse Spark tables: managed vs external) on Fabric Notes, Microsoft Data Cloud Advocacy team.