How-to

How to create measures for charts in Hubviz

Create measures such as revenue, average ticket or order count: pick the calculation, the value field, the date and the filters, and check the preview.

A measure is the number a chart shows: revenue, order count, cost. It takes a cube field, applies a calculation (sum, average, count) and spreads the result over time using the date field.

When to use it

  • Before building a chart or a table: column charts, line charts and cards read measures.
  • When the same number shows up in several charts. Create the measure once and reuse it.
  • When the number needs a fixed cut, such as “Retail revenue” or “Canceled orders”.

Before you start:

  • Choose and save the cube fields, with at least one date field. See Cube fields.
  • If you need a row-by-row calculation (profit, margin), create a calculated field first.
  • Save the cube. With no fields chosen and saved, Hubviz shows: To create measures, please select the fields you'd like to use in the mapping first, then save the cube.

Create the measure

  1. In the Cubes menu, open the cube.

  2. Open the Integration Measures tab and click Add Integration Measure. The Create Integration Measure window opens on the Form tab.

  3. Fill in Name with the name that will show in the chart, such as “Revenue”.

  4. Fill in Description with a short sentence about the calculation.

  5. Pick the Aggregation Type (see the table below).

  6. In Base Date Field, pick the date that defines the period, such as the issue date. The list only shows fields with the date format.

  7. In Value Field, pick the field to calculate, such as revenue. In some types, such as the counts, this field is optional.

  8. If you want to break the number down by category, pick a Grouping Field, such as the business unit or the salesperson. This field is optional.

  9. Check the result in the preview on the right.

  10. Click Save. The measure is stored right away, without waiting for you to save the cube.

The measure shows up in the tab’s list. The Related charts column shows how many charts use each measure.

Form options

FieldWhat it doesRules
NameThe measure’s name in charts and in the editor.Required. 3 to 50 characters.
DescriptionA sentence for whoever uses the measure.Up to 200 characters.
Aggregation TypeThe calculation that joins the values of each period.Required.
Base Date FieldThe date that puts each row in its period (day, month, year).Required. Only fields with the date format.
Value FieldThe field the calculation sums, counts or compares.Required, except for the types marked optional below. The list groups fields by format (Number, Decimal, Currency and others).
Grouping FieldBreaks the result down by category, such as one series per business unit.Optional.
Data FiltersLimits the rows that enter the calculation.Optional. See below.

Relationship fields and calculated fields show up in the lists like any other field, as long as they are checked in the mapping.

Aggregation types

Hover over a type in the list to read its description.

TypeWhat it doesValue field
SumAdds all values in the period.Required
AverageCalculates the average of the values in the period.Required
CountCounts values in the period while ignoring duplicates.Optional
MaximumReturns the highest value found in the period.Required
MinimumReturns the lowest value found in the period.Required
Count (Average)Calculates the average of values inside each displayed period.Optional
Count (Last Record)Counts how many records exist on the last day of the period.Optional
Sum (Last Record)Adds the last value of each day inside the period.Required
Count (First Record)Returns the value of the first record in the period.Optional
Last record valueReturns the value of the last record in the period.Optional

How to choose:

  • A value that accumulates over the period (revenue, cost, quantity sold): Sum.
  • A typical value (average ticket, average lead time): Average.
  • How many records exist (orders, customers): Count. Repeated values count once, and Hubviz warns about it when you pick the type.
  • Highest and lowest value (biggest sale, lowest stock): Maximum and Minimum.
  • Balances and positions (stock, customer base, portfolio): the “Last Record” types, which look at the end of the period instead of summing everything.

Filter the measure’s data

Use filters when the measure should consider only part of the rows, such as “Retail revenue” or “Canceled orders”.

  1. In the measure window, scroll to Data Filters and click Add Filter. The first filter starts with a blank condition.
  2. If you want, change the filter’s name. Click the name (Hubviz suggests “Filtro 1”, “Filtro 2” and so on, in Portuguese).
  3. Pick the Field to Filter. The list shows each field’s format.
  4. Pick the Comparison and the value in Value of.
  5. To require more than one condition at the same time, use Add more items to this filter. The conditions are joined by AND.
  6. To accept one condition or another, use Add Condition Block. Each block is an alternative, joined by OR: the row enters the measure if it meets any of them.

The value field changes with the format of the chosen field.

Field formatValue fieldNotes
TextText box with suggestionsSuggestions come from the values read in the cube (up to 50 at a time). You can type a value that isn’t in the list.
Number, Decimal, CurrencyNumberType just the number, with a decimal point.
BooleanTrue or False
DateDate editor (see below)The comparisons change to the date ones.

Comparisons

For fields that aren’t dates, the list comes from the Hubviz server. It has:

Equal, Greater, Greater or Equal, Less, Less or Equal, Different, Contains, Does Not Contain, Starts with, Ends with, Different (Months), Between and Not between.

For date fields, the list is Is equal to, Is not equal to, Is after, Is on or after, Is before, Is on or before, Is between and Is not between.

Date filter

In Date type, choose how to give the date:

TypeHow it worksExample
Exact dateA fixed calendar date.01/01/2026
Relative dateA number of days, weeks, months or years before or after today. It moves by itself every day.30 days before today
PeriodA ready-made period: today, yesterday, this week, this month, this quarter, this year and others, including “to date”, “last” and “next”.This quarter to date
RangeFrom a start to an end. Use with Is between or Is not between.From 01/01/2026 to 03/31/2026

The editor shows the resolved period so you can check the real dates.

Check the preview

The right side of the window shows the measure’s result with the cube data. It updates by itself, about one second after the last change.

TabWhat it shows
Preview ChartThe measure’s chart by period. With a grouping field, one series per category.
Preview Processed DataThe table with the calculated values.
Preview Raw DataThe cube rows that entered the calculation, with paging.
Alert iconShows up when the preview finds problems in the data, such as invalid dates. Open it to see the warnings grouped, with the source rows.
  • The preview uses only the first records (5,000 at most), so totals of large cubes can differ from the final chart.
  • The calendar button at the bottom left changes the preview period. It is the same period as the project in Hubviz Studio.
  • Fields with the Time format show as a duration.

Edit as text

The Advanced tab shows the same measure written as text. What you change on one side shows on the other.

DEFINE MEASURE "Retail revenue"
DESCRIPTION "Revenue of the Retail unit only"

AGGREGATE Sum ON receita
BY data
GROUP BY unidade

FILTER BY
  "Filtro 1" WHERE
    unidade Equal "Retail"
LineWhat it defines
DEFINE MEASURE and DESCRIPTIONThe name and the description.
AGGREGATE type ON fieldThe aggregation type and the value field (none when there is none).
BY fieldThe base date field.
GROUP BY fieldThe grouping field. Leave it out to not group.
FILTER BYThe filters. Each block has a name and a WHERE. Conditions in the same block are joined by AND. Blocks are separated by OR.

The text uses the fields’ technical names, the aggregation type name and the comparison name as they appear in the lists, and values in double quotes. The tab suggests words and fields as you type. If the text has an error, the tab shows the syntax message and the preview waits.

Manage the cube’s measures

The list on the Integration Measures tab has a search by name, description or ID and one row per measure.

Column or buttonWhat it does
Measure nameThe name and the description.
AggregationThe chosen aggregation type.
Related chartsHow many charts use the measure. Click to see which.
EditOpens the measure.
DuplicateCreates a copy, with a suffix in the name. Disabled while the cube has no chosen fields.
Delete integration measureDeletes the measure.
CheckboxesSelect several measures to delete at once with Delete selected.

When you delete a measure that charts use, Hubviz warns that the charts may stop working. Switch the measure in the charts before deleting.

In the measure window, the Recent Measures section lists the cube’s latest measures. Click Load to start from one of them.

Example: the Sales cube measures

The Sales cube (fields data, unidade, receita, custo, meta and the calculated lucro_bruto) has four measures, all with Sum, base date data and grouping by unidade:

MeasureValue field
Revenuereceita
Costcusto
Targetmeta
Gross profitlucro_bruto

For a Retail-only number, create “Retail revenue”: same setup as Revenue, with a filter Field to Filter Business unit, Comparison Equal, value Retail. To know how many sales rows exist per month, create “Sales records” with Count.

Messages and limits

MessageCause and fix
Measure name must be at least 3 charactersUse a more descriptive name.
Measure name cannot be longer than 50 charactersShorten the name.
Description cannot be longer than 200 charactersShorten the description.
Aggregation type is requiredPick a type from the list.
Date field is requiredPick the base date field.
Date field must be of date typeThe chosen field doesn’t have the date format. Adjust the format in Cube fields.
Value field is required for this aggregation typePick the value field, or switch to a count type.
Filter name is required, Filter field is required, Filter comparison is required, Filter value is requiredFill in every field of each filter condition.
Some filters contain fields that no longer exist. Please review filters before saving.A field used in the filter left the mapping. Pick another field.
Cube not saved. Please save the cube first to create a measure.Save the cube (Ctrl + S) and try again.
No fields mapped. Please map the fields first to create a measure.Choose the fields on the Field Mapping tab.

Next steps