Join fan-out happens when one record matches multiple records in another dataset, producing multiple joined rows. If a report then sums a gift amount repeated on those rows, it can overstate revenue even though the original gifts are correct. To prevent it, define what one row represents, test matches per gift, and calculate each measure at an appropriate level before combining results.
This We Learn Wednesday lesson is for nonprofit analysts, fundraisers, and agency teams who need to explain why a campaign dashboard no longer agrees with its gift ledger. The example is illustrative, not a description of a particular ReportWerks integration or report.
How join fan-out inflates fundraising revenue
A join combines records using a shared key. A one-to-many relationship means one record can match several records on the other side. Neither is inherently wrong: the problem arises when a measure from the one side is summed after it has been repeated.
Imagine two eligible gifts from one donor: gift A is $100 and gift B is $100. The donor also has three campaign touchpoints. Joining gifts to touchpoints on donor ID alone produces six rows: each gift appears once for each touchpoint.
| Measure | Gift ledger | After the donor-level join |
|---|---|---|
| Gift rows | 2 | 6 joined rows |
| Sum of gift amount | $200 | $600 |
| Distinct gift IDs | 2 | 2 |
The $600 is a sum of joined rows, not six gifts or $600 in actual revenue. A distinct gift count can still look correct while the amount is wrong. The Google Cloud training material on model files illustrates the same one-to-many fan-out problem.
Start with grain and the business question
Reporting grain is what one row represents. Write down the grain and key of each input: for example, one row per gift ID in a gift table and one row per touchpoint ID in an engagement table. Then state the desired output grain, such as one row per donor for a donor-level summary. Our guide to metrics and dimensions provides useful context for distinguishing the value being measured from the way it is grouped.
Ask what relationship the report is meant to represent. A shared donor ID establishes a match to that donor; it does not prove that a touchpoint caused a gift, occurred before it, or belongs to the same campaign. A meaningful attribution analysis needs its own documented timing, eligibility, and credit rules.
Run a four-part fan-out check
- Freeze the scope. Use the same gift eligibility rules, dates, currency, and filters for both the baseline and the joined report. Record the as-of time.
- Build the baseline. Count unique gift IDs and sum eligible gift amounts directly from the gift source. Check whether gift IDs are unique there.
- Inspect matches per gift. After the join, group by gift ID and count matched rows. More than one match means that gift’s amount repeats if summed at joined-row level. Check missing matches too: an inner join can drop unmatched gifts.
- Reconcile by segment. Compare joined and baseline counts and dollars overall and by campaign or time period. Test a few known gifts, including one with multiple touchpoints and one with none. A matching grand total alone does not prove every segment is correct.
Record the query or report version, owner, and differences. If the source refresh or eligibility rules differ, resolve that discrepancy before diagnosing the join.
Choose the fix for the question
Summarize each source before joining
For a donor-level summary, independently total eligible gifts to one row per donor and count touchpoints to one row per donor. Join those two summaries on donor ID, retaining the intended donor population. Verify that each summary has at most one row per key and reconcile the gift total back to the ledger. Pre-aggregation at the intended shared grain avoids multiplying the gift total by the touchpoint count.
That summary answers how much each donor gave and how many touchpoints were recorded. It does not assign individual gifts to individual touchpoints or campaigns. For campaign-level reporting, use a valid gift-to-campaign relationship or a documented allocation rule; donor-level totals alone cannot establish it.
Use a presence test when you only need a filter
If the question is “How much did donors with at least one eligible touchpoint give?”, test whether such a touchpoint exists instead of returning every match. In SQL, EXISTS is one way to express that test. Apply the intended time and campaign conditions inside the test. The result is giving by donors who meet the condition, not proven revenue caused by the touchpoint.
Use distinct counts carefully
COUNT(DISTINCT gift_id) can count unique gifts in a joined result, but it does not repair an inflated SUM(amount) or recover gifts dropped by an inner join. SUM(DISTINCT amount) is not a general fix either: in the example it returns $100 because both legitimate gifts have the same amount, understating the correct $200.
What if a gift has several campaigns?
A many-to-many relationship can be legitimate. The same gift may be associated with multiple campaign records. Decide whether the report shows full credit in every category, a single designated campaign, or a documented allocation across campaigns. Full credit can help show associations, but category totals must not be added together as unique organization-wide revenue. If allocating, verify that each eligible gift’s shares sum to 100% and explain the rule. These are reporting choices, not proof of causality.
A practical release checklist
- Each input and output has a named grain and a tested key.
- Gift counts and revenue reconcile to a baseline under the same scope.
- Multiple and missing matches are visible and understood.
- Segment totals and overall totals have appropriate, documented credit rules.
- A named owner approves the result and retains the check for the next refresh.
Start with one dashboard tile whose total matters to a current decision. Trace it back to the eligible gift ledger, inspect the join, and document what each row means. Then repeat the check whenever the source, join, or business rule changes. For the next stage of review, use the campaign closeout dashboard checklist to connect reconciled figures with sign-off and follow-up.





