ConradBI home

Home  /  How-to  /  Model your data

Facts and measures

Join your grain to its dimensions and turn its numbers into measures that every visual can use.

The short version

  • A Basic Fact reads one grain, links each of its rows to the dimensions, and holds the measures. Sales has one row per order line.
  • In the Dimensions grid, pick a dimension for each grain column, then the dimension's column it matches. A column with the same name is picked for you.
  • A measure is a grain column with an aggregation, an alias and a display format: Revenue, added up with Sum, shown as Currency.
  • DAR-C Calculations add measures you write yourself, such as margin percent.
  • Visuals read the processed fact. Process it before you build visuals, and again after each change.
Back to How-to guides
In this guide
  1. What a Basic Fact is
  2. Before you start
  3. Build Sales
  4. The Dimensions grid
  5. Plain columns: degenerate columns
  6. True / False values
  7. Measures
  8. Display formats
  9. DAR-C calculations
  10. Process the fact
  11. When something goes wrong
  12. Reference

What a Basic Fact is

The fact is the middle of the star. If the idea is new, start with Star schema basics.

A Basic Fact is built from one grain. For every row of the grain, it:

  1. finds the matching row in each dimension and keeps that row's key, such as Site Key,
  2. keeps the grain's plain columns, such as Channel, as they are,
  3. keeps the value of each measure, such as Revenue.

It doesn't add anything up. Sales keeps one row per order line, and a visual adds the rows up when it groups them, by region, by month or by whatever the visual shows. So one fact answers every question its dimensions allow.

When the grain and the dimensions are all in SQL Server, the fact is built on the server. Otherwise it is built on your computer. The result is the same.

Before you start

You need:

This guide builds Sales:

Part What it holds
Measures Revenue, Cost and Units, each added up with Sum
Dimensions Site, Product, Customer, Order Date and Ship Date
Plain columns Order ID, Channel and Status, carried from the grain

Build Sales

This takes about ten minutes.

  1. In the element list, click the + on the Facts row. In Add element, type Sales in Name and click OK. The new fact opens in the editor.
  2. Under Grain, set Grain element: to Order Lines. Only grains are offered.
  3. Under Measures, click Add measure. In the new row, pick Revenue under Fact column. Aggregation starts at Sum and Alias fills in as Revenue Sum: change the alias to Revenue. Under Format, pick Currency.
  4. Add Cost the same way: Cost, Sum, alias Cost, Currency. Then Units: Units, Sum, alias Units, Number with Commas ticked.
  5. Under Dimensions, each of the grain's Dimension columns has a row. On the Site Code row, pick Site under Dimension. Dimension column fills in with Site Code, because the names match.
  6. Do the same on the Product Code row with Product, and on the Customer ID row with Customer.
  7. On the Order Date row, pick Order Date, then pick Date under Dimension column. On the Ship Date row, pick Ship Date.
  8. Leave the other rows, such as Site Name and Region, at (none).
  9. Save the fact: ProjectSave, or Ctrl+S.
  10. In the Services panel, click Process all. When the run finishes, open the fact and look at the Data tab.

Each row of Sales now holds Site Key, Product Key, Customer Key, Order Date Key and Ship Date Key, then Order ID, Channel and Status, then Revenue, Cost and Units. Order ID, Channel and Status came without a step, because they are Degenerate in the grain.

The fact is ready for visuals. Add a Card on Sales with Revenue, or a Bar Chart of Revenue by Region.

Tip: Name measures as your business says them. The alias is the name visuals and DAR-C use: AggregateFact(Sum, Revenue) in the DAR-C guide reads this measure.

The Dimensions grid

The grid has one row for each Dimension column of the grain:

Column What it holds
Grain column The grain's column, such as Site Code
Dimension The dimension it joins, or (none)
Dimension column The dimension's column it matches. Pick it, or type it
✕ Clears the row: the grain column joins nothing

You never add a dimension to the fact or name a join yourself. The joins follow from the rows you map, and each join is named after its dimension. Each one gives the fact a key column named after the join: Site Key, Order Date Key.

When you pick a dimension, the dimension's column with the grain column's name is picked for you. Where the names differ, as Order Date and Date do, pick it yourself.

An order line whose value matches no row of the dimension gets the key of the unknown member, −1, and shows under "(blank)" in visuals. A blank value never matches, so it gets −1 too.

If a column leaves the grain, or stops being Dimension, its mapping stays in the grid with a note that it isn't in the grain any more. Click its ✕.

Composite joins

Map two or more grain columns to the same dimension, each to a different column of it, and they make one join on all of them. The fact still gets one key.

Use one when no single column picks the row:

  • A junk dimension. Order Profile holds Channel and Status together. Set both to Dimension in the grain, then map Channel to its Channel and Status to its Status.
  • A Changing Dimension that follows change. If Site holds two rows for a site that moved region, map Site Code and Region to Site, so each order line finds the row with its own region. See Build dimensions.

Every mapped column has to match. An order line with a blank in any of them gets the unknown member.

A second join of the same dimension

Map a grain column to a dimension column that another row already uses, and you start a second join of that dimension. Say the Ship Date row is mapped to Order Date and its Date column, like the Order Date row. The second join is named after the dimension and its grain column, Order Date (Ship Date), and its key column is Order Date (Ship Date) Key. A name that is already taken gets a number after it.

A second join works, but visuals see one set of the dimension's columns for both joins, so they can't tell an order's date from its ship date. For a second role that visuals keep apart, build a Role Playing Dimension, as Ship Date is in Date dimensions, and map the row to it.

Plain columns: degenerate columns

Some columns describe the order line itself and need no dimension: Order ID, Channel, Status. In the grain, their Mode is Degenerate. The fact carries every Degenerate column of its grain onto each row, as it is, without a setting of its own.

Visuals group and filter by them directly. In DAR-C they are written under the fact's name: [Sales].[Channel]. To add or remove one, change its Mode in the grain.

A degenerate column can be a measure too, for a count. See Measures.

True / False values

When the fact has a degenerate column holding True or False, a True / False values group appears at the bottom of the editor, with a row for each such column.

Say the grain has a Bulk Order column, made with a Custom Column step from [Units] >= 100 and set to Degenerate. Type Bulk under True value and Standard under False value. When the fact is processed, the column holds those words instead, as text, and charts show Bulk and Standard. Leave both blank to keep the raw True and False.

While a True / False value is set, the fact is built on your computer, even when everything is in SQL Server.

Measures

A measure is one of the grain's columns, ready to be added up. Each row under Measures has:

Column What it holds
Fact column The grain column. The list offers the grain's Fact and Degenerate columns
Aggregation How visuals add the measure up
Alias The measure's name. It starts as the column and the aggregation, such as Revenue Sum, until you type your own
Format How its values show. See Display formats
✕ Removes the measure

The fact keeps each order line's own value. The aggregation is applied when a visual groups the rows, so the same Revenue gives a total per region on one chart and per month on another.

Aggregation Gives Example on Sales
Sum The total Revenue, Cost, Units
Average The total divided by the count Average Unit Price
Min, Max The smallest or largest value Largest Discount
Count How many values are not blank Order lines with a Discount
Distinct Count How many different values there are Orders: Order ID with Distinct Count

One column can feed several measures. Unit Price can be an Average and a Max, each with its own alias. Give every measure a name of its own: a DAR-C calculation can't take a measure's name either.

DAR-C's AggregateFact can use more methods than these six, such as Median and CountRows. See Aggregations in the DAR-C guide.

Display formats

A format decides how a measure's values show, in every visual that uses it. Pick the kind under Format, then its options beside it:

Format Options Example Notes
None 1234.567 The value as it is
Number Commas 1234.567 shows 1,235 A whole number
Decimal Commas, Decimals 1234.567 shows 1234.57 2 decimals at first
Currency Commas, Decimals 1234.567 shows $1,234.57 A $ before the number. Commas is ticked at first
Percent Decimals, ×100 (0.42 → 42%) 0.42 shows 42% A % after the number. 0 decimals at first
Custom Pattern #,##0.0 shows 1,234.6 A pattern as Excel writes one, such as 0.0% or $#,##0;($#,##0). For another currency sign, write it in: €#,##0.00

Decimals takes 0 to 6 places.

×100 (0.42 → 42%) is ticked at first. Leave it ticked when the value is a fraction, as a margin of 0.42 is: it shows 42%. Untick it when the value is already a percentage, such as 42: it shows 42% instead of 4200%.

The format travels with the measure. A chart's axis that shows thousands or millions keeps it: a Currency measure reads $1.25K.

For Custom patterns, such as euros, negatives in brackets or sales in thousands, see Custom number and date formats.

DAR-C calculations

A measure adds up one column. For anything more, such as margin percent, a share of a total, or this month against the same month last year, add a calculation under DAR-C Calculations. The group lists the calculations by name on the left and edits the one you pick on the right. Click Add calculation: the new one goes to the top of the list and opens on the right. Give it an Alias and a Format, and write it in the box below them. A calculation with an alias and no mistakes is offered to visuals beside the measures. Problems show under the box, such as "Give the calculation an alias." Drag a name up or down to reorder the list, click Delete calculation to remove the one you picked, and type in Filter by name at the bottom to show only the names that contain what you type. The DAR-C guide teaches the language, starting with margin percent.

Process the fact

Visuals draw from the fact's processed rows, not from its settings. So process the fact before you build visuals on it, and again whenever you change its grain, its dimensions or its measures.

  • Process all, in the Services panel, processes every element in order: the grain, the dimensions, then the fact.
  • Process current processes only the element open in the editor, on its own.

The Orchestration tab of the Services panel shows each element's run, with its rows and status, and the Data tab shows the fact's rows.

When something goes wrong

What you see What to do
Grain element: doesn't list your prep A fact reads a grain. Build one over the prep: see Define the grain
A column is missing from the Dimensions grid Set its Mode to Dimension in the grain
A column is missing from the Fact column list Set its Mode to Fact or Degenerate in the grain
Sales show under "(blank)" when grouped by a dimension Their codes find no row: check Dimension column, look for codes missing from the dimension or blank in the grain, and check the dimension's Filter. For a date, see Date dimensions
The fact's status says rows of a dimension share their key with an earlier row The dimension has more than one row for a code you join on, and the fact uses the first. Fix the data so each code has one row, or map the dimension's other columns too, as a composite join
A measure is called Revenue Sum That is the default alias. Type your own under Alias
"Give the calculation an alias." Type an Alias for the DAR-C calculation
"The alias '…' is already used." Give each measure and calculation a name of its own
A Percent shows 4200% instead of 42% The value is already a percentage. Untick ×100 (0.42 → 42%)
A Percent shows 0% for a small share Raise Decimals, or check that ×100 (0.42 → 42%) is ticked
Visuals show old numbers Process the fact again
A mapping has a note that it isn't in the grain any more The grain column is gone, or no longer Dimension. Click its ✕

Reference

Group Settings
Grain Grain element: the grain the fact reads
Measures Add measure. Each row: Fact column, Aggregation (Sum, Average, Min, Max, Count, Distinct Count), Alias, Format, ✕
DAR-C Calculations The names on the left, the one picked on the right. Add calculation, Delete calculation, Filter by name. Each one: Alias, Format, the calculation
Dimensions Each row: Grain column, Dimension, Dimension column, ✕
True / False values Shown for True or False degenerate columns. Each row: Column, True value, False value
Format None, Number, Decimal, Currency, Percent or Custom, with Commas, Decimals, ×100 (0.42 → 42%) or Pattern where they apply

Missing something?

Tell us what you were trying to do and what this guide didn't answer. We update it with every release.

Write to us

What changed in this guide

  • November 21, 2026: Updated for 1.2.59: the Custom format with a Pattern, and the fact's note when a dimension holds a key twice.
  • October 31, 2026: First edition, written for ConradBI 1.2.52.