WEEKFOUND EXCEL REPORT EXAMPLE
Demonstration using entirely fictional data. This is not a client project.
No measured time-saving or business-outcome claims are made.

WHAT IS INCLUDED
orders.csv: 20 order rows. One row represents one complete order with one product.
product-costs.csv: 9 unit-cost rows, including a deliberately duplicated product key.
order-report.pq: the complete Power Query M script.
expected-output.csv: all 20 transformed rows, in their original source order.
expected-summary.csv: the expected row counts and report totals.
weekfound-excel-report-example.xlsx: a formatted expected-output view with line calculations and review rows.

The XLSX is an expected-output snapshot. It does not contain an installed native
Power Query connection. Its line arithmetic and totals use Excel formulas, but
editing its source tabs does not rerun the separate Power Query script.
Install the script once using the instructions below to create a refreshable query.

SETUP IN EXCEL DESKTOP FOR WINDOWS
1. Extract the ZIP into a local folder you can keep, such as C:/WeekFoundExample/.
   Keep orders.csv and product-costs.csv directly in that folder.
2. Open the supplied workbook in Excel Desktop. Preserve the expected-output
   sheets so you can compare your result. Do not load the new query over them.
3. Select Data > Get Data > From Other Sources > Blank Query.
4. In Power Query Editor, select Home > Advanced Editor.
5. Open order-report.pq in a text editor, copy its entire contents, and replace
   the Advanced Editor contents. Change the FolderPath line to your folder,
   ending in a slash. Forward slashes work for the supplied Windows example.
   Example: FolderPath = "C:/Users/YourName/Documents/WeekFoundExample/",
   Keep the quotation marks and the comma at the end of the line.
6. Select Done and name the query OrderReport. Confirm that it contains 20 rows.
   FolderPath and both filenames must match their actual location.
7. Select Home > Close & Load > Close & Load To, then Table and New worksheet.
8. Review Status and ReviewReason before reporting totals. Only Status=Ready
   rows belong in this example's financial totals. Do not simply sum all orders.
9. To keep separate views, reopen the Power Query Editor, right-click OrderReport
   and select Reference. Name one reference ReadyOrders, filter Status to Ready,
   and load it to a new worksheet. Repeat as ReviewOrders, filtering to Review.
   Reference reuses the same transformations. Leave OrderReport intact.
10. After correcting the CSV files, select Data > Refresh All. Compare the new
    rows and totals with your expectations. Never edit query output as a source
    correction: refresh would overwrite that edit.

If a file cannot be found, check FolderPath and the two filenames. If Excel shows
a permissions or privacy prompt, use settings appropriate to your own files and
organisation. Do not globally disable privacy checks. This example needs no
online account, API key, macro, live connection or customer data.

EXPECTED RESULTS FROM THE UNCHANGED FILES
20 input rows = 5 Ready rows + 15 Review rows.
Ready revenue: GBP 360.00.
Ready product cost: GBP 229.00.
Ready gross profit: GBP 131.00.
Gross margin: 131 / 360 = 36.3888889%, shown as 36.4%.
The zero-price, zero-cost O1010 order is Ready. Its margin is blank because its
revenue is zero. A genuine numeric zero must not be treated as missing input.

WHAT THE SCRIPT DOES
It requires the supplied exact CSV columns, trims text and uppercases order and
product IDs. It parses ISO yyyy-MM-dd dates and numbers using en-GB settings.
It counts duplicate order IDs before calculating anything. Both duplicate rows
are marked Review; it does not silently choose one record to keep.
It groups product costs before the left join, so duplicate product keys never
multiply order rows or produce an arbitrary first-match cost.
It preserves every input order row and adds a source CSV row number (header=1).
Review reasons cover missing/invalid IDs, customer, date, quantity, price and cost.
Unknown products, duplicate cost keys, nonpositive quantities and negative prices
or costs are held for review. Zero prices and zero costs are allowed.
It calculates Revenue=Quantity*UnitPrice and ProductCost=Quantity*UnitCost, each
rounded to two decimal places with ties away from zero. GrossProfit is their
difference. Financial amounts are null for Review rows, not invented zeroes.
The script sorts by SourceRow so refresh produces a stable comparison order.

HUMAN REVIEW AND BUSINESS SCOPE
Confirm the authoritative duplicate record with the source owner. Fix missing
costs, unknown products and invalid fields in the source files, then refresh.
This simple example assumes one row per order and one current cost per product.
Real multi-line orders need a unique order-line key. Dated cost changes need an
effective-date lookup. Returns need an explicit policy; this sample excludes
nonpositive quantities. Negative gross profit on an otherwise valid order is
allowed, because selling below cost is not a data-format error.
All monetary fields are GBP excluding VAT. Product cost only is subtracted;
delivery, discounts, labour, overheads and revenue-recognition adjustments are
outside this demonstration. This is not a full accounting profit calculation.

PLATFORM SUPPORT AND LIMITATIONS
The walkthrough targets current Excel Desktop for Windows (Microsoft 365).
Microsoft documents Power Query in Excel 2016 and later Windows editions, but
feature availability differs by edition. Use a supported current installation.
For Microsoft 365 Excel for Mac, Data > Get Data supports Text/CSV and Blank
Query. Replace FolderPath with your Mac's absolute folder path, ending with /,
and grant file access if macOS requests it. Menus and available connectors vary
by version. The supplied query has not been executed in Excel for Mac.
Excel for the Web supports Power Query for supported data sources and plans,
but this File.Contents query points to local computer files. That local path is
not a browser refresh source. Use desktop Excel for this download; a web version
would need a separately configured supported cloud source, such as SharePoint.
Power Query is not supported in Excel for Android or iOS.
Poppins is the specified workbook font. Excel may substitute a local font if
Poppins is not installed; content and calculations do not depend on that font.

VERIFICATION
The example's expected rows and totals were independently reconciled, including
duplicate keys, missing/invalid values, zero price/cost, negative quantity and
negative cost. Excel arithmetic recalculated after a quantity change, then the
original inputs were restored. The workbook was exported, reimported and all four
worksheets visually rendered without formula errors. Native Excel Desktop and
the Power Query refresh engine were not run in this environment.

MICROSOFT PRIMARY SOURCES (checked 12 October 2026)
Supported Excel versions and data sources:
https://support.microsoft.com/en-us/excel/power-query-data-sources-in-excel-versions
Excel for Mac import and query editing:
https://support.microsoft.com/en-us/excel/import-and-shape-data-in-excel-for-mac-power-query
Excel for the Web capabilities:
https://support.microsoft.com/en-us/excel/use-power-query-in-excel-for-the-web
CSV import options:
https://learn.microsoft.com/en-us/powerquery-m/csv-document
Grouping records:
https://learn.microsoft.com/en-us/powerquery-m/table-group
Joining tables:
https://learn.microsoft.com/en-us/powerquery-m/table-nestedjoin
Date parsing:
https://learn.microsoft.com/en-us/powerquery-m/date-fromtext

You can reuse and adapt the WeekFound-authored example files for your own work.
Microsoft Excel and Power Query are Microsoft products; this is an independent
WeekFound demonstration, not a Microsoft-endorsed template.
