A Retail Data Mart in Excel: OData Feeds and PivotTables That Refresh
The feed worked last month. Today Excel answers with an OData Invalid URL error, and the PivotTables sit on stale numbers. That error is where most Excel reporting built on Business Central feeds dies, not because the design was wrong, but because the failure looks like the data’s fault. It usually is not. This guide builds the data mart properly, published feeds, one query per retail fact, PivotTables over the top, and puts the known failure and its documented fix inside the routine, where they belong.
Publish only the feeds the mart needs
OData queries expose tables via the Web Services page in Business Central, and new sources are added there with New and a page or query reference. The mart needs a short, deliberate feed list, sales, inventory, customers, not every page anyone ever published. Each extra feed is another endpoint that can change, another query to refresh, and another candidate when something breaks.
To publish a page that is not yet a web service:
- Open the page in Business Central and press Ctrl-Alt-F1 to open Page Inspection, which shows the page’s name, number, and type. As a reference point, the Item List is page 31.
- On the Web Services page, add the page as a web service: Object Type Page, the page reference, and the publish checkbox ticked.
- Reload the Web Services page. The page’s OData URL appears once it is published.
- Repeat for each feed the mart needs, and add all of them before building queries, adding every web service at the start of a report-building session reduces how often the Invalid URL failure appears.
One naming example is worth copying: the Account Schedules web service is named powerbifinance, set up on the Account Schedule KPI Web Service Setup page. Short, purpose-named services stay recognisable months later; a list of auto-named feeds does not.
What success looks like: the Web Services page lists exactly the feeds the mart uses, each published, each with its OData URL visible after a reload, and nothing else the workbook depends on is left unpublished.
One query per fact: sales, inventory, customers
- Copy the OData link from the Web Services window in Business Central.
- In Excel, use Get Data > From Other Sources > From OData Feed, and paste the link.
- Choose Transform Data to open the Power Query Editor before loading anything to a sheet.
- Trim the query in Power Query: keep the columns the PivotTables actually use, and set sensible types while still in the editor.
- Load the cleaned query, then repeat steps 1–4 once per fact, a sales query, an inventory query, a customer query, so each fact can refresh and fail independently.
- Where two facts must combine, join them in the Power Query Editor, which can create columns and join two data sources. Joins belong in the query layer, not in spreadsheet formulas stretched across sheets.
What success looks like: the workbook holds one named query per retail fact, each traceable to a published web service, and no sheet contains a hand-maintained copy of feed data.
On protocol choice, one sourced practitioner note applies: Sabre’s guidance records the author’s experience of using OData rather than OData V4 in Excel. Treat that as a documented preference to test against the local tenant, not as a Microsoft rule.
PivotTables that survive a Refresh All
Build each PivotTable directly on a loaded query’s output, never on a copied range. The refresh contract then stays simple:
| Action | Documented behaviour |
|---|---|
| Data > Queries & Connections > Refresh All | Refreshes the report, updating fields outside a data-type card as well as the card itself |
| Close and reopen the workbook | Also refreshes the report |
| Hand-editing cells inside a query’s output range | Breaks the contract, the next refresh owns those cells; corrections belong in Business Central or in a Power Query step |
Because each PivotTable sits on its own query, a failure names its own fact: the sales PivotTable going stale points at the sales query, not at the workbook as a whole. That separation is the entire reason for the one-query-per-fact rule.
When refresh breaks: the cache failure, in the routine
The documented Invalid URL workaround in Excel runs in this order:
- Go to Data > Get Data > Query Options > Data Load, and choose Clear Cache.
- Restart all workbooks.
- Re-add the endpoint.
Two facts keep this failure in proportion. Microsoft’s team classified the invalid-URL behaviour as not a bug, so expecting a permanent product fix is the wrong plan; the cache routine is the plan. And adding all web services at the start of a report-building session reduces how often it appears, which is why the build procedure above publishes every feed before the first query exists.
Decide the fix by the symptom
| Symptom | Decision |
|---|---|
| Refresh All completes without errors | Stop. The workbook is current as of that refresh; quote from it. |
| OData Invalid URL error | Run the Clear Cache routine in order, clear the cache, restart all workbooks, re-add the endpoint. Do not rebuild queries first. |
| One query fails while the others refresh | Treat it as that fact’s feed, not the workbook: check the web service behind that query is still published, then refresh that query alone. |
| Figures look unchanged after a refresh | Close and reopen the workbook, reopening also refreshes the report, and check the refresh time before quoting the figures. |
Note: a refreshed workbook shows data as of its last successful refresh. Check the refresh completed before quoting any figure from it.
Checklist: the monthly data-mart health check
- Feeds: every query in the workbook still points at a published web service on the Web Services page; no feed the mart needs has been unpublished.
- Refresh: Refresh All completes with no query erroring; any Invalid URL failure gets the Clear Cache routine, in order, before endpoints are rebuilt.
- Joins: joins live in Power Query, where they were built, not in sheet formulas added since.
- PivotTables: each one still sits on a query output, with no hand-edited cells inside the output ranges.
- Scope: new reporting requests get a new query or a new PivotTable on an existing query, never a copied sheet of feed data.
The data mart earns its keep by being boring: the same feeds, the same queries, the same refresh, month after month. The Invalid URL error will still visit occasionally. Inside a routine that already contains its fix, it costs minutes. Outside one, it costs the whole workbook, because the next person rebuilds from scratch in a spreadsheet, and the cycle starts over.
, Dex Carter, Tech Writer
IndexBack to all guides →