Measures

A measure is a named SQL aggregation, such as a total or an average, that every report on a semantic model can use. This page covers the measure library: the Measures section of the BI tables panel, where you add, organise and watch over your measures. For writing a measure's expression, see Measure editor; for tests and previews, see Measure tests.

What the Measures section shows

Add and open a measure

  1. Right-click Measures in BI tables and choose Add measure, or use the add button on the Measures row. A BI table's or a column's menu offers Add measure too.
  2. The measure editor opens with a new draft, named with the first free number such as Measure 1, until you rename it.
  3. Write the expression and save the measure. Measure editor describes the editor, its AI help and its shortcuts.

To open a saved measure, select it in the tree or choose Open in its menu; the editor opens beside the panel.

File measures into folders

  1. Right-click Measures and choose Add folder. The new folder appears in rename mode with a default name like Folder 1; type a name and press Enter.
  2. Drag a measure row onto a folder to file it. The folder highlights when the dragged measure can land there.
  3. To take a measure out of a folder, choose Remove from folder in its menu, or drag it onto the Measures row.
  4. A measure's menu also holds Move to folder, with a New folder item inside it. Folder rows have their own menu: Rename folder, Create measure in this folder and Delete folder.
  5. Deleting a folder asks Delete folder? and explains: This removes the "<label>" folder. Its measures are kept and move back to "No folder". The measures stay in the model.

Rename, copy and delete a measure

  1. Choose Rename in a measure's menu, or double-click its row. Enter commits the name, Escape cancels, and clicking away commits too.
  2. A name that another measure already holds is refused as you type: Another measure is already named "<name>".
  3. A name that a column or a BI table holds is refused when you save the measure: measure validation failed: measure name "<name>" collides with a column or BI table name of the semantic model. Rename the measure, or the object that holds the name.
  4. Copy name copies the measure's name.
  5. Delete asks first. The dialog reads Delete measure? with This will permanently delete "<name>". This action cannot be undone. When other measures use the measure, it also warns: "<A, B> use this measure - deleting will invalidate them until a measure named "<name>" exists again."

See broken measures

Note

A red measure is never deleted. It stays in the model and is only left out of charts until it works again.

Read test status at a glance

Hide a measure from report field lists

Permissions

Questions, answered

Why is the Measures section missing from the tree?

A search in BI tables that matches no measure hides it until you clear the search. On a report tab, the section lists only the measures the selected visual uses.

What happens to a folder's measures when I delete the folder?

They stay in the model and move back to No folder. Only the folder is removed.

Why can't I rename a folder to a name that already exists?

Folder names are labels, so two folders with the same name would read as one. Choose a different name; the refusal reads A folder with this name already exists.

Why can't I drag my new measure into a folder?

Drafts cannot be dragged or filed. Save the measure first, then drag it into a folder.

Where does a measure go when I drop it on empty space?

Nothing changes. A drop only files a measure when it lands on a folder; released over empty space, it keeps its place. To take a measure out of a folder, choose Remove from folder, or drag it onto the Measures row.

What does the dot next to a measure mean?

It summarizes the measure's tests. Hover it to read something like 3 test(s): 2 pass, 1 fail, 0 error, 0 never run. Green means all its tests pass, red means a test failed or errored, and grey means some have not run yet. See Measure tests.

What does the red Invalid badge mean?

The measure fails its validity check: it references a missing or invalid measure, its name now collides with a column or BI table name, or it failed its check after its table was replaced. It is left out of charts until it is fixed, and it is never deleted. Correct the expression and save, or select Re-check once the cause is gone.

Why can't I see the re-check icon on the broken-measures chip?

It only appears for people who can edit the semantic model. Ask an administrator for Edit DataPrism Semantic Model; see Who can do what in DataPrism.

I renamed a measure. Do my reports still work?

Yes. Reports that use the measure show the new name, and measures that reference it have their expressions updated to follow the rename.

If I hide a measure, do existing charts break?

No. A hidden measure only leaves report field lists; charts that already use it keep working. Choose Show in reports to bring it back.

Can I delete a measure that other measures use?

Yes, but the confirmation warns that the measures that use it stay invalid until a measure named "<name>" exists again. If you want to keep it out of the way instead, hide it from report field lists.

Why does a test run say the test runner is busy?

The test runner was handling other work and did not take the run. Wait a moment, then run the tests again. See Measure tests for runs and budgets.