Guides

How to Build Invoice Line Items with Relations and Rollups in Notion

Build invoice line items in Notion with two linked databases, relations, rollups, and formulas, then turn each invoice into a clean PDF with PDFOutput.

By Sanat Biswal · 2026-11-14 · 5 min read

How to Build Invoice Line Items with Relations and Rollups in Notion

{/ synced-from-notion — do not edit manually /}

How to Build Invoice Line Items with Relations and Rollups in Notion

You open your Notion invoice page and add a row for design work, another for hosting, and a third for a revision round. Then you pull out a calculator to add them up, type the total by hand, and hope you didn’t miss anything. The next month you copy the page, change a few numbers, and forget to update the total.

This is the problem that relations and rollups solve. Instead of typing totals, you keep every line item as its own record, link it to an invoice, and let Notion do the maths.

In this guide, we will build an invoice system in Notion with two linked databases, a line total formula, rollups for the subtotal, tax, and grand total, and then look at how to turn each invoice into a finished PDF using PDFOutput.

The short version:

create an Invoices database and a Line Items database, connect them with a relation, add a formula for each line total, and add rollups on the invoice to sum those lines.

Once the numbers are right, PDFOutput can fill a Google Docs or Word template from each invoice record and generate the PDF.

Table of Contents

  • Why Line Items Need Their Own Database
  • What You Need Before You Start
  • Step 1: Create the Line Items Database
  • Step 2: Create the Invoices Database
  • Step 3: Connect Them With a Relation
  • Step 4: Calculate Each Line Total
  • Step 5: Add Rollups to the Invoice
  • Step 6: Add Tax and the Grand Total
  • Adding Discounts
  • From Invoice to PDF With PDFOutput
  • Templates: Table Rows vs Single Fields
  • A Quick Checklist
  • Troubleshooting Table
  • Frequently Asked Questions
  • Related Reading
  • Conclusion
  • Why Line Items Need Their Own Database

    It is tempting to build an invoice as a single Notion page with a table inside it. It works for one invoice. It starts to hurt by the third.

    Three things go wrong with that approach:

  • Totals are typed by hand. A table block inside a page can’t add up its own rows into a property, so the total depends on you remembering to update it.
  • Line items can’t be reused or reported on. If every line lives inside a different page, you can’t easily ask “how much did we bill for hosting this year?”
  • The data isn’t structured. A database property can be read by automations and tools. Text inside a table block is much harder to use.
  • When each line item is its own database record, linked to an invoice, you get structure for free. You can filter, group, total, and export it, and the invoice total updates whenever a line changes.

    What You Need Before You Start

    You only need a Notion workspace and a few minutes. Plan for two databases:

    DatabaseWhat each row representsExample
    InvoicesOne invoice sent to one clientINV-0042, Acme Ltd
    Line ItemsOne charge on one invoiceLogo design, 1 × 500
    The rest of this guide uses these names. Rename them to suit your business, but keep the structure.

    Property names and menus change as Notion updates, so treat the exact labels below as a guide and check them in your own workspace.

    Step 1: Create the Line Items Database

    Create a new database and name it Line Items. Add these properties:

    PropertyTypePurpose
    DescriptionTitleWhat you are charging for
    QuantityNumberHow many units, hours, or items
    Unit PriceNumber (currency format)Price of one unit
    Tax RateNumber (percent format)Tax for this line, such as 18%
    Line TotalFormulaQuantity × Unit Price (added in Step 4)
    Keep the title short and readable. Whatever you write here is what your client may see on the invoice.

    Step 2: Create the Invoices Database

    Create a second database and name it Invoices. Start with the basic properties:

    PropertyTypePurpose
    Invoice NumberTitleFor example, INV-0042
    Client NameTextWho you are billing
    Client EmailEmailWhere the invoice is sent
    Issue DateDateWhen the invoice is issued
    Due DateDateWhen payment is expected
    StatusSelectDraft, Sent, Paid, Overdue
    We will add the money properties (subtotal, tax, and total) after the relation is in place, because they depend on it.

    Step 3: Connect Them With a Relation

    A relation is a property that links records in one database to records in another.

  • In the Line Items database, add a new property.
  • Choose Relation as the type.
  • Select the Invoices database as the one to link to.
  • Turn on the option to show the relation on Invoices as well, so the link works in both directions.
  • Name the property on Line Items “Invoice”, and the property on Invoices “Line Items”.
  • Now every line item can point to exactly one invoice, and every invoice shows all of its line items. This two-way link is what makes rollups possible.

    If you want each line item to belong to only one invoice, you can limit the relation to one page. Check the relation settings in your version of Notion.

    Step 4: Calculate Each Line Total

    In Line Items, edit the Line Total formula property. A simple version looks like this:

    prop("Quantity") * prop("Unit Price")

    That gives you the amount before tax. To avoid long decimals from things like 3 hours at 33.333, round to two places:

    round(prop("Quantity") prop("Unit Price") 100) / 100

    If you also want a tax amount per line, add a second formula property called Tax Amount:

    round(prop("Line Total") prop("Tax Rate") 100) / 100

    The exact formula syntax can change as Notion updates its formula editor, so test with a sample line before you trust it. Add one line with a quantity of 2 and a unit price of 150, and check that the line total shows 300.

    Step 5: Add Rollups to the Invoice

    A rollup looks at the records linked through a relation, picks one of their properties, and calculates something from it.

    In the Invoices database, add a property called Subtotal:

  • Choose Rollup as the property type.
  • For Relation, pick “Line Items”.
  • For Property, pick “Line Total”.
  • For Calculate, pick Sum.
  • Now add a second rollup called Tax with the same relation, the “Tax Amount” property, and Sum.

    Open an invoice, link two or three line items to it, and watch the subtotal change. If you edit a quantity on a line, the invoice updates by itself. That is the whole point of doing it this way.

    A couple of other rollup calculations are useful:

    • Count all gives you the number of line items on the invoice.
    • Show original lists the linked values, which can be handy for text such as descriptions.
    • Step 6: Add Tax and the Grand Total

      Add a formula property to Invoices called Total:

      prop("Subtotal") + prop("Tax")

      Format the Subtotal, Tax, and Total properties as currency so they read the same way on every invoice.

      If your tax rate is the same on every line, you can skip the per-line tax and use one Tax Rate property on the invoice instead, with a formula such as:

      round(prop("Subtotal") prop("Tax Rate") 100) / 100

      Per-line tax is better when you sell a mix of taxable and non-taxable items, or items at different rates. Tax rules vary by country and business, so confirm yours with an accountant before you send invoices.

      Adding Discounts

      There are two common ways to handle discounts without breaking your totals.

    • A negative line item. Add a line called “Early payment discount” with a quantity of 1 and a negative unit price. The rollup sums it like any other line.
    • A discount property on the invoice. Add a number property for the discount and subtract it in the Total formula.
    • The negative line is simpler and also shows the discount clearly on the final document. The property approach keeps the line items list clean. Pick one and use it consistently.

      From Invoice to PDF With PDFOutput

      Once your totals work, the invoice is only half done. The client needs a document, and Notion’s own export isn’t built for branded invoices. It has no repeating headers or footers, and the layout follows the page rather than a template.

      This is where PDFOutput fits. PDFOutput creates documents from your Notion data using a template. The template can be a Google document, a Word file, a PDF file, or a Notion page. You add placeholders in double curly braces, such as {{Client_Name}}, and each placeholder must match the related Notion property name.

      For your invoice database, that means placeholders like:

      PlaceholderNotion property
      {{Invoice_Number}}Invoice Number
      {{Client_Name}}Client Name
      {{Issue_Date}}Issue Date
      {{Due_Date}}Due Date
      {{Subtotal}}Subtotal (rollup)
      {{Tax}}Tax (rollup)
      {{Total}}Total (formula)
      Because the layout lives in a Google Docs or Word file, you also get the things a word processor does well: your logo in the header, page numbers, a footer with payment details, and a clean cover for longer documents.

      You can start generation from a Notion database button or a status property. These are some of the status options:

    • Ready to Generate creates a PDF from the database record.
    • Generate Page converts the Notion page into a PDF.
    • Generate PDF and Doc creates a PDF and a Google document.
    • Preview creates a Google document so you can check it before making the final PDF.
    • Generate E-Signed Doc creates an e-signed PDF in the database workflow.
    • Use Preview on your first few invoices to check the numbers, the layout, and the wording before you create the final PDF.

      Templates: Table Rows vs Single Fields

      Single values such as the client name, total, and due date map neatly to one placeholder each. Line items are different, because an invoice can have two lines or twenty.

      There are two practical ways to think about it:

    • A line items table in the template. If you want each line item on its own row, check PDFOutput’s documentation for how it handles related records and repeating rows, and test it with an invoice that has several lines before you rely on it.
    • A summary in one field. Add a rollup on Invoices that shows the original values of the related line descriptions, and use it in a single placeholder. This is less polished, but it is a safe fallback when a simple summary is enough.
    • Whichever you choose, test with a realistic invoice. Fill it with the longest invoice you expect to send, and check that nothing runs off the page.

      A Quick Checklist

      Before you send your first invoice from this setup, run through this list.

    • Line Items and Invoices are separate databases, joined by a two-way relation.
    • Every line item is linked to an invoice.
    • Line Total is a formula, and a test line gives the answer I expect.
    • Subtotal and Tax on the invoice are rollups with the Sum calculation.
    • Total is a formula that adds the subtotal and tax.
    • Money properties are formatted as currency.
    • My template placeholders match the Notion property names exactly.
    • I’ve used Preview to check a sample invoice before generating the final PDF.
    • I’ve checked the tax treatment with my accountant.
    • Troubleshooting Table

      What you seeLikely causeWhat to try
      Subtotal shows 0No line items are linked, or the rollup points to the wrong propertyLink a line item, and check the rollup uses “Line Total” with Sum
      Subtotal is correct but Total is wrongThe Total formula references the wrong propertyCheck it uses Subtotal and Tax, not Line Total
      Long decimals such as 99.99999Floating point maths with no roundingWrap the formula in round( ... * 100) / 100
      Line item doesn’t appear on the invoiceThe relation isn’t set on that rowOpen the line item and select the invoice
      Rollup option is missingThe relation property doesn’t exist yetAdd the relation first, then the rollup
      Placeholder shows up empty in the PDFName mismatch, or the property is emptyMatch the property name exactly and check the record has a value
      Currency symbol is missingThe property is formatted as a plain numberChange the property format to currency in Notion

      Frequently Asked Questions

      Can I build invoice line items in Notion without a second database?

      You can use a table block inside the page, but it can’t roll its totals up into a property. A separate Line Items database with a relation is the more reliable setup if you need totals that update by themselves.

      What is the difference between a relation and a rollup in Notion?

      A relation links records in one database to records in another. A rollup reads a property from those linked records and calculates something, such as a sum or a count.

      Why does my rollup show 0?

      Usually no records are linked yet, or the rollup is reading a property that is empty. Check the relation first, then the property and calculation chosen in the rollup.

      How do I add tax to invoice totals in Notion?

      Either add a tax amount formula to each line item and roll up the sum, or use one tax rate property on the invoice and multiply it by the subtotal. Confirm the right approach for your country with an accountant.

      Can I generate a PDF invoice from a Notion database?

      Yes. A tool such as PDFOutput can fill a Google Docs or Word template with the values from each invoice record and save the PDF to your chosen storage.

      Will the PDF update if I change a line item?

      The Notion totals update right away. A PDF that was already generated won’t change, so generate it again after editing, and use Preview to check the result.

      Related Reading

    • How to Export Notion to PDF
    • How to Fix Page Breaks in Notion PDF
    • How to Add Your Logo and Brand Colors to Notion PDFs

    Conclusion

    A Notion invoice that depends on typed totals will go wrong sooner or later. Putting each charge in a Line Items database, linking it to an invoice with a relation, and using rollups for the subtotal and tax means the numbers take care of themselves.

    Once the data is clean, the last step is the document. PDFOutput can fill your Google Docs or Word template from each invoice record, so the finished PDF carries your branding, your headers and footers, and totals that match Notion.

    Want invoices that build themselves and arrive as clean PDFs? Try PDFOutput.