Cat On A Spreadsheet

Designing a Shared Data Model for Multiple Excel Reports

One of the most common problems in business reporting is that different reports gradually develop different versions of the same information: a finance report calculates total transaction value, an operations report uses the same transactions to measure departmental performance, a customer report groups those transactions by region, while a management dashboard presents a monthly trend. Initially, each report may be straightforward. But as requirements evolve, their calculations begin to diverge. One report excludes cancelled transactions; Another excludes cancelled and pending records; a third has an additional adjustment that somebody introduced six months ago. Department names are maintained in one worksheet, customer regions in another, and several reports contain their own copies of the reference data. Eventually, management asks a seemingly simple question: why do the reports disagree?

 

The problem is not necessarily an incorrect formula - each individual report may calculate exactly what its developer intended. The problem is that the reports no longer share a consistent definition of the underlying data.

 

In the previous post, we combined Power Query, dynamic arrays and VBA into an automated reporting pipeline. Power Query prepared the source data, dynamic arrays performed the calculations, and VBA created static outputs for management review. That architecture worked well for one reporting workbook. Now we will extend the idea by designing a shared reporting data model: a set of related tables and business rules that several reports can use without independently reconstructing the same information.

 

We are not trying to build a data warehouse inside Excel; the aim is considerably more modest: we want to make the source data consistent, the relationships between records explicit and the reporting calculations reusable.

 

Start with the meaning of a record

 

Before deciding how many tables we need, we should establish what one row in the central transaction table represents. In database and reporting terminology, this is called the grain. Suppose our organisation processes sales transactions. Each record has a transaction identifier, date, customer, department, status and value. For this example, we will assume that one row represents one complete transaction, and that each transaction identifier is unique. That assumption is important. If our source instead contained one row per invoice line, counting rows would give us the number of invoice lines, not necessarily the number of invoices. A single invoice containing five products could appear five times. Both structures are legitimate, but they support different interpretations of transaction count.

 

We should not build the report first and discover the grain afterwards.

 

Our central table will contain TransactionID, TransactionDate, CustomerID, DepartmentID, Status and Value. Notice what is missing: we have not included customer names, regions or department descriptions in the transaction table as those attributes belong to separate reference tables. This might seem less convenient initially - after all, a single wide table containing everything would allow us to filter and aggregate without performing lookups, but there are good reasons to separate these fields. A customer name can change; a department can be renamed; or a customer's region may be corrected or reassigned. If we repeat those descriptions on every transaction, we either duplicate the information thousands of times or rely on the source system to preserve the appropriate historical values. By storing stable identifiers in the transaction table and descriptive information in reference tables, we establish a clearer relationship between the transaction and the business entities it refers to: the transaction tells us what happened and the reference tables tell us what the identifiers represent. This structure resembles a simplified star schema, with a central fact table connected to several dimension tables.

 

Building the shared tables

 

Let's call the central Power Query result qFactTransactions. It contains the six fields described above, with appropriate data types assigned during import. A second query, qCustomers, produces a customer table containing CustomerID, CustomerName and Region. A third query, qDepartments, contains DepartmentID and DepartmentName.

 

For now, we do not need a more elaborate organisational hierarchy. We can extend the department table later if management requires divisions, cost centres or reporting groups. The important point is that each reference table should contain one row per identifier. CustomerID should uniquely identify a row in the customer table and DepartmentID should uniquely identify a row in the department table. The transaction table is different. A customer or department may appear in many transactions, so those identifiers are expected to repeat there. This gives us a one-to-many relationship: one customer can have many transactions, and one department can have many transactions. The identifiers are what connect those records.

 

For example, the transaction table might contain DepartmentID equal to D01, while the department table identifies D01 as Finance. If Finance is renamed Financial Services, we update the descriptive record. We do not need to rewrite the department identifier on every historical transaction. However, that convenience comes with an important qualification. A renamed department and a transaction that has been reassigned to another department are not the same thing. Similarly, if a customer moves from one region to another, looking up the customer's current region will classify all historical transactions under the new region. That may be correct for a report using the current organisational structure, but it may be wrong for a historical performance report. A shared model must therefore distinguish between descriptive changes that should apply retrospectively and historical attributes that need to remain fixed. We will return to that distinction shortly. For the moment, we have three related tables with clearly defined responsibilities. The next decision concerns which transactions are eligible for reporting.

 

Define business rules once

 

In our earlier reporting engine, the definition of a valid transaction was embedded directly in the formula. A transaction was included when its status was "Posted" and its date fell within the selected reporting period. That works when one calculation produces all the reports. But suppose we now have several independent reports. The department summary may use SUMIFS, the customer analysis may use MAP and FILTER, and the monthly trend may be generated using MAKEARRAY. If each report independently implements the status rule, we have created several places where that rule can change.

 

A simple improvement is to create another Power Query query, called qPostedTransactions, which references qFactTransactions. In Power Query's Advanced Editor, the essential transformation is Table.SelectRows(qFactTransactions, each [Status] = "Posted"). We are not duplicating the original source query and independently maintaining its import and cleaning steps, we are creating a query that depends on the prepared transaction dataset. We can then load the result into an Excel Table named tblPostedTransactions.

 

Our reporting workbooks now have two distinct concepts. qFactTransactions represents the prepared transaction history, including records with different statuses. qPostedTransactions represents the subset that satisfies our shared reporting rule. The operational reports can consume tblPostedTransactions without repeating the status condition. If the business later changes the definition of a posted transaction, there is one obvious place to review that logic.

 

There is an important limitation to understand here. Referencing a Power Query query centralises the definition of its transformations, but it does not necessarily mean Power Query executes the underlying source retrieval only once. Referenced queries can be evaluated independently, and actual caching behaviour depends on the execution environment and refresh process. We should therefore distinguish logical reuse from guaranteed performance optimisation. For our relatively modest reporting system, the main benefit is consistency and maintainability.

 

The important result is that every downstream report receives transactions defined by the same rule. However, we should not discard the original status information altogether. The prepared transaction query still needs to be available for audit and validation, even if it is kept as a connection-only query rather than loaded into a visible worksheet. Otherwise, we would lose the ability to investigate which records were excluded and why.

 

This distinction between a prepared dataset and a reporting population is something we have encountered throughout the series. Now we are making it part of the workbook's structure rather than embedding it independently inside every report.

 

Building the first report from the shared model

 

Let's start with a straightforward department summary. We will assume that qPostedTransactions has been loaded into tblPostedTransactions, with TransactionID, TransactionDate, CustomerID, DepartmentID and Value columns. We also have tblDepartments, containing DepartmentID and DepartmentName. The report should show one row per department, the number of posted transactions and their total value within the selected period. As before, H2 and H3 contain dates within the first and last reporting months.

 

Our first instinct might be to extract the unique department identifiers from the transaction table. That would work, but it would omit departments with no posted transactions in the current dataset. A better approach for a complete departmental report is to take the department list from the master table.

 

This creates a subtle but useful separation: the reference table determines which departments exist and the transaction table determines their activity. The two should not be confused.

 

We can now construct the summary using the familiar COUNTIFS and SUMIFS functions:

=LET(
     StartDate,EOMONTH(H2,-1)+1,
     EndExclusive,EOMONTH(H3,0)+1,
     DepartmentIDs,tblDepartments[DepartmentID],
     DepartmentNames,tblDepartments[DepartmentName],
     Counts,COUNTIFS(tblPostedTransactions[DepartmentID],DepartmentIDs,tblPostedTransactions[TransactionDate],">="&StartDate,tblPostedTransactions[TransactionDate],"<"&EndExclusive),
     Totals,SUMIFS(tblPostedTransactions[Value],tblPostedTransactions[DepartmentID],DepartmentIDs,tblPostedTransactions[TransactionDate],">="&StartDate,tblPostedTransactions[TransactionDate],"<"&EndExclusive),
     Report,HSTACK(DepartmentNames,Counts,Totals),
     VSTACK({"Department","Transactions","Value"},SORTBY(Report,DepartmentNames,1))
)

 

There is nothing particularly exotic about the calculation. The department identifiers come from the reference table, we use them as the criteria for aggregating the posted transactions, then display the corresponding department names. The key difference is architectural.

 

The report no longer has to decide what constitutes a posted transaction, nor does it need to derive department names independently. Those decisions have already been made by the shared data model. This means the report formula concentrates on its actual responsibility: presenting department-level activity for the selected period. It also means that a department with no activity receives a count and total of zero rather than disappearing from the report. If the business maintains a list of active departments, we could filter tblDepartments to those marked active before calculating the measures. That would be a separate business rule, and it should be implemented deliberately.

 

One qualification is important. Our formula assumes that every DepartmentID in tblPostedTransactions exists in tblDepartments. If a transaction refers to an unknown department, its value will not appear in the departmental rows. This is why relationship validation becomes part of the shared model rather than something each report should be expected to repair. We'll examine that shortly.

 

Using the same transactions in a customer report

 

Now suppose management wants a regional report based on the customers responsible for those transactions. The transaction table does not contain a region - it contains CustomerID. The customer table contains CustomerID, CustomerName and Region. We therefore need to associate each posted transaction with its customer's region.

 

We could merge the customer attributes into the transaction query using Power Query. For a worksheet-based solution, that can be a sensible choice when many reports repeatedly use the same enrichment. But we also have the option of keeping the tables separate and performing the lookup within the dynamic-array calculation. Let's use that approach to illustrate how several related tables can work together without duplicating their underlying records. The report will retrieve a region for each transaction using XLOOKUP, identify the distinct regions and calculate total posted value for each one.

=LET(
     StartDate,EOMONTH(H2,-1)+1,
     EndExclusive,EOMONTH(H3,0)+1,
     Dates,tblPostedTransactions[TransactionDate],
     Values,tblPostedTransactions[Value],
     TransactionRegions,XLOOKUP(tblPostedTransactions[CustomerID],tblCustomers[CustomerID],tblCustomers[Region],"[Unmapped]"),
     Regions,SORT(UNIQUE(TransactionRegions)),
     Totals,MAP(Regions,LAMBDA(Region,SUM(FILTER(Values,(TransactionRegions=Region)*(Dates>=StartDate)*(Dates<EndExclusive),0)))),
     VSTACK({"Region","Value"},HSTACK(Regions,Totals))
)

 

Again, the formula is not particularly complicated once we understand the underlying model. XLOOKUP translates customer identifiers into regions, UNIQUE establishes the groups, and MAP applies the aggregation to each region. Every region represented in the posted transaction history appears in the report, including those with no transactions during the currently selected period.

 

We have also introduced an explicit "[Unmapped]" category for transactions whose customer identifiers cannot be found in the customer table. That prevents an unmatched identifier from being silently assigned to an ordinary region. However, it is not intended as a substitute for validating the reference data. In a production report, an unmapped customer should normally trigger an investigation rather than simply being accepted as another region.

 

Notice that the customer and department reports are now independent calculations over the same prepared transaction population. They can use different dimensions and aggregation techniques, but they do not have different definitions of posted activity, and neither maintains its own copy of the reference data. That is exactly what we wanted from the shared model.

 

There is a further distinction worth making. Our regional formula uses the customer's current region as recorded in tblCustomers. If the requirement is to report transactions according to the region assigned at the time of each transaction, we would need historical region information and a different lookup rule. A shared model makes that choice visible, but it does not resolve it automatically.

 

Validating the relationships between tables

 

Once a report relies on multiple tables, data validation becomes more important. In a single wide table, missing descriptive information is usually visible as an empty cell. In a model with separate reference tables, the problem may appear as a failed lookup, an unmapped category or a total that does not reconcile.

 

Consider a posted transaction containing DepartmentID equal to D99. If D99 does not exist in tblDepartments, what should happen? Our department summary uses the identifiers from tblDepartments as its reporting rows. Consequently, the transaction assigned to D99 will not appear under any department. The formula can still calculate perfectly; it may show no Excel error at all, but the reported departmental total will be incomplete. This is why the relationships between tables need their own validation checks.

 

For example, we can count how many posted transactions refer to department identifiers that do not exist in the department table:

 

=SUM(--ISNA(XMATCH(tblPostedTransactions[DepartmentID],tblDepartments[DepartmentID])))

 

A result of zero indicates that every posted transaction has a matching department identifier. We can create an equivalent check for customer identifiers. These checks are not reporting measures - they are data-integrity controls.

 

We should also verify that identifiers in each reference table are unique. If tblDepartments contains two records for D01, a lookup may return the first match without telling us that the reference data is ambiguous. A simple uniqueness check compares the total number of reference rows with the number of distinct identifiers.

 

For example, ROWS(tblDepartments[DepartmentID])-ROWS(UNIQUE(tblDepartments[DepartmentID])) tells us how many additional occurrences exist beyond the distinct department identifiers. This assumes the master table is populated; blank identifiers should be validated separately.

 

There is another potential problem when we merge tables. Suppose our transaction table contains one record for department D01, worth €500, but the department reference table accidentally contains two rows with that identifier. A Power Query merge followed by expansion could duplicate the transaction, depending on how the join is constructed. The resulting dataset might now contain two €500 records. The report would show €1,000 even though the source transaction was worth only €500. This is a particularly dangerous kind of error because the output may appear entirely plausible. It illustrates why we should establish and test the expected relationship cardinality before using a reference table to enrich transactions.

 

For our design, each customer and department identifier should correspond to exactly one master record. If that expectation is violated, the correct response is generally to investigate the reference data rather than accept the duplicated result. A shared model does not eliminate the need for data quality checks. It gives us a more consistent place to apply them.

 

Introducing a calendar dimension

 

Our earlier time-intelligence examples demonstrated how to generate reporting months using SEQUENCE and EDATE. That approach remains useful, but as the number of reports grows, we may find ourselves repeatedly implementing calendar logic. One report groups transactions by calendar month; another uses financial quarters; a third requires financial years beginning in April. At that point, a shared calendar table becomes attractive.

 

We could create a query called qCalendar that generates one row per date across the period covered by our reporting system. The resulting table, tblCalendar, might contain Date, CalendarYear, CalendarMonth, MonthStart, FinancialYear and FinancialQuarter, and every date would appear once.

 

This establishes a common definition of reporting periods. The advantage is particularly clear when dealing with non-standard financial calendars. If the organisation has a financial year beginning in April, we do not want different reports independently calculating financial quarters using slightly different formulas. The calendar table can define those periods once, and reports can then use the same attributes when grouping or comparing transactions. This is also useful when the business uses irregular accounting periods, such as a 4-4-5 calendar. In that case, a maintained mapping of dates to accounting periods may be much easier to understand and validate than increasingly complicated worksheet formulas.

 

One detail requires care if we connect the calendar to transaction dates. Our TransactionDate field may contain times, but the calendar table contains one date per day without time components. If we later use relationships in Excel's Data Model, it is sensible to create a separate date-only key in the transaction data. Otherwise, a transaction recorded at 14:30 may not match the corresponding midnight date value in the calendar table. We can preserve the original timestamp while deriving the date key for reporting.

 

That is another example of separating source information from analytical attributes. The source tells us precisely when the transaction occurred while the model provides the reporting date and period classifications. Both are useful, and neither needs to overwrite the other.

 

When to use Excel's actual Data Model

 

So far, we have used the term data model to describe the logical organisation of our tables, their relationships and the rules applied to them. Excel also has a specific feature called the Data Model, associated with Power Pivot. These are related concepts, but they are not identical. Our current approach uses Power Query to prepare tables and dynamic-array formulas to relate and aggregate their contents. Excel's Data Model offers another way to work with those tables. Instead of loading everything exclusively into worksheet Tables and using XLOOKUP to retrieve attributes, we can load related tables into the Data Model and establish relationships between them. For example, the transaction table can be linked to the customer table through CustomerID and to the department table through DepartmentID. The lookup-side identifiers must be unique, and the related columns must have compatible types. Excel's Data Model supports one-to-many relationships of this kind. Once those relationships exist, PivotTables and DAX measures can use the model without requiring us to copy descriptive attributes into every transaction row.

 

We could define a measure representing posted transaction value and use it in reports grouped by customer region, department or reporting month. The underlying measure would remain consistent across those reports. This is a particularly attractive approach when we have large transaction histories, many relationships and numerous reports using the same measures, however it changes the reporting architecture. Our existing dynamic-array formulas operate directly on worksheet ranges and Tables, they do not automatically gain access to Data Model relationships merely because those relationships have been created. If we move calculations into Power Pivot, we need to use the appropriate Data Model reporting interfaces, such as PivotTables and DAX measures.  Where appropriate, Excel's CUBE functions can also retrieve results from the model.

 

That is a different calculation environment from our LET, FILTER and MAKEARRAY reporting engine and we should therefore make the choice deliberately. For a workbook with a moderate amount of data and a few custom dynamic-array reports, keeping the prepared tables on worksheets may be perfectly sensible. For a larger system involving many related tables and substantial aggregation, the Data Model may provide a better foundation.

 

We can even combine the approaches, using the Data Model for established aggregations and dynamic arrays for additional worksheet-level presentation or analysis - but the benefit needs to justify the extra complexity. The purpose of building a shared model is not to force every reporting workbook into Power Pivot. It is to make the data and its business definitions consistent.

 

Historical reporting requires historical information

 

There is another issue that becomes more important as a shared model develops. Suppose customer C102 belongs to the East region during 2025 but moves to the West region in March 2026. Our current customer table contains one row per customer and records the customer's latest region. If we use XLOOKUP to retrieve the region, every historical transaction for C102 will be assigned to West. Is that correct? It depends on the report. If management wants to analyse historical sales according to the current customer organisation, the result may be exactly what is intended, but if management wants to know what East and West actually generated during 2025, the result is wrong. The current customer table no longer contains enough information to answer that historical question.

 

This cannot be fixed by choosing a more sophisticated lookup formula, we need historical reference data. One approach is to store the region applicable at the time of the transaction as a separate field in the prepared transaction dataset. Another is to maintain a history of customer-region assignments, with effective start and end dates. The reporting process can then associate each transaction with the assignment that was valid on its transaction date.

 

In data modelling, this belongs to the broader problem of handling slowly changing dimensions. We do not need to implement a complete historical dimension system for our current workbook, but we should recognise when it becomes necessary. A shared reference table containing only current attributes is not automatically suitable for historical reporting.

 

The same issue can arise with departmental reorganisations, product categories, account managers and cost-centre assignments. A report that uses today's organisational structure to classify transactions from three years ago may answer a different question from the one management expects. The model must preserve the information needed by the intended analysis. This is another reason to establish reporting requirements before choosing the table structure.

 

One source of truth does not mean one enormous table

 

There is a temptation to interpret a shared reporting model as a requirement to construct one complete dataset containing every field that any report might ever need, but that is not necessarily desirable. A single wide table might be convenient for some worksheet formulas, but it also creates considerable duplication. Customer names, regions, department descriptions and other attributes may be repeated thousands of times. More importantly, merging multiple datasets without understanding their relationships can accidentally duplicate transaction records.

 

The objective is not to place all information in one physical table, it is to establish one consistent definition of each piece of information. Customer details belong to the customer reference data. Department descriptions belong to the department reference data. Transaction values and identifiers belong to the transaction records. A particular report may need those fields combined, and Power Query or Excel formulas can perform that enrichment, but the combined dataset should be a deliberate reporting output, not another independently maintained copy of the underlying business information.

 

The same principle applies to calculations. If several reports require posted transaction value, they should share the same rule for identifying posted transactions. That does not necessarily mean every report must call the same enormous formula. A shared Power Query transformation, a named LAMBDA, or a DAX measure may all be reasonable ways to centralise the relevant logic. The correct mechanism depends on where the calculation belongs and how the reports consume it. The objective is consistency rather than architectural uniformity.

 

Keeping the model maintainable

 

A model containing several related tables is already more sophisticated than a workbook with one pasted transaction extract. It therefore deserves a little more documentation. We should know what each table represents, what one row means, which identifiers uniquely identify its records and how it relates to the other tables. We should also know where its data comes from and how it is refreshed, and the business rules used to construct the reporting population should be clear.

 

For example, qPostedTransactions should have an explicit definition of what qualifies as posted activity. If management decides that a particular adjustment status must also be included, the change should be made deliberately and tested against the reports that depend on the query. This is where the testing techniques from earlier in the series become particularly valuable. We can verify that the total value of tblPostedTransactions agrees with the expected status-filtered population from qFactTransactions, we can verify that every customer and department identifier resolves to the appropriate reference record, we can verify that the department, regional and monthly summaries all reconcile to the same underlying total when they cover the same population, and we can use controlled test data to make sure that changes to reference information do not unexpectedly duplicate or exclude transactions.

 

Not every report will reconcile to exactly the same figure. Some may have additional criteria, different measures or different reporting periods. The important thing is that differences should be explainable in terms of those requirements rather than arising from independent and inconsistent data preparation.

 

We should also be careful about refresh behaviour. A shared model may contain several Power Query queries, some of which reference others. If reports or output procedures are triggered before the relevant refreshes have completed, they may use data from different update stages. The orchestration concerns from our previous post therefore remain relevant. The model gives us consistent definitions, but the refresh process must still ensure that the related datasets are ready before reports are produced.

 

From multiple reports to one reporting foundation

 

Let's return to the original problem. Management has a department report, a customer-region report and a monthly performance report. Without a shared model, each report might maintain its own imported transactions, reference lookups and filtering rules. That can work initially, but it becomes increasingly difficult to guarantee consistency as the reports evolve.

 

With our shared structure, the process is clearer: Power Query prepares the transaction history and its reference tables; the posted-transaction query establishes the reporting population; the department report uses the department identifiers and names to produce departmental measures; the customer report uses the customer reference table to group the same transactions by region; a monthly report can use the same population alongside a shared calendar definition. Each report may have its own layout, controls and calculations, but the underlying information comes from the same prepared source and follows the same agreed rules.

 

That is the practical advantage of a shared reporting data model - it reduces duplicated transformations, makes discrepancies easier to investigate and provides a stronger foundation for additional reports, and it also gives us more options as the system grows. We can continue using dynamic arrays for flexible, interactive worksheet reports, we can introduce Power Pivot and DAX when the volume or complexity of the relationships justifies it, or we can use VBA to create static management outputs without making it responsible for rebuilding the underlying data. The reporting architecture can evolve without requiring every part of the process to be redesigned at once.

 

But there is an important final consideration. Our model may be consistent today, yet source records and reference information can change tomorrow. A transaction may be corrected after month-end. A previously cancelled document may be posted. A customer may be reassigned to another region. If we refresh the workbook and reproduce last month's report, will we get the same numbers that management reviewed originally? Perhaps not. That is not necessarily a calculation error - it may simply mean that the underlying data has changed.

 

For some operational reports, showing the latest corrected position is exactly what we want. For financial and management reporting, however, we may also need to preserve the position that was reported at a particular point in time, and this introduces a new challenge: distinguishing the current state of the data from historical reporting snapshots.

 

In the next post, we will examine how to handle historical corrections, reporting snapshots and reproducible month-end figures in Excel, so that a refresh does not silently rewrite the history of what was previously reported.

30 November 2026

Full Service Consulting

Reporting

Automation

Cat On A Spreadsheet

Cat On A Spreadsheet