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
-
In the Cubes menu, open the cube.
-
Open the Integration Measures tab and click Add Integration Measure. The Create Integration Measure window opens on the Form tab.
-
Fill in Name with the name that will show in the chart, such as “Revenue”.
-
Fill in Description with a short sentence about the calculation.
-
Pick the Aggregation Type (see the table below).
-
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.
-
In Value Field, pick the field to calculate, such as revenue. In some types, such as the counts, this field is optional.
-
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.
-
Check the result in the preview on the right.
-
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
| Field | What it does | Rules |
|---|---|---|
| Name | The measure’s name in charts and in the editor. | Required. 3 to 50 characters. |
| Description | A sentence for whoever uses the measure. | Up to 200 characters. |
| Aggregation Type | The calculation that joins the values of each period. | Required. |
| Base Date Field | The date that puts each row in its period (day, month, year). | Required. Only fields with the date format. |
| Value Field | The 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 Field | Breaks the result down by category, such as one series per business unit. | Optional. |
| Data Filters | Limits 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.
| Type | What it does | Value field |
|---|---|---|
| Sum | Adds all values in the period. | Required |
| Average | Calculates the average of the values in the period. | Required |
| Count | Counts values in the period while ignoring duplicates. | Optional |
| Maximum | Returns the highest value found in the period. | Required |
| Minimum | Returns 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 value | Returns 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”.
- In the measure window, scroll to Data Filters and click Add Filter. The first filter starts with a blank condition.
- If you want, change the filter’s name. Click the name (Hubviz suggests “Filtro 1”, “Filtro 2” and so on, in Portuguese).
- Pick the Field to Filter. The list shows each field’s format.
- Pick the Comparison and the value in Value of.
- To require more than one condition at the same time, use Add more items to this filter. The conditions are joined by AND.
- 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 format | Value field | Notes |
|---|---|---|
| Text | Text box with suggestions | Suggestions 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, Currency | Number | Type just the number, with a decimal point. |
| Boolean | True or False | |
| Date | Date 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:
| Type | How it works | Example |
|---|---|---|
| Exact date | A fixed calendar date. | 01/01/2026 |
| Relative date | A number of days, weeks, months or years before or after today. It moves by itself every day. | 30 days before today |
| Period | A 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 |
| Range | From 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.
| Tab | What it shows |
|---|---|
| Preview Chart | The measure’s chart by period. With a grouping field, one series per category. |
| Preview Processed Data | The table with the calculated values. |
| Preview Raw Data | The cube rows that entered the calculation, with paging. |
| Alert icon | Shows 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"
| Line | What it defines |
|---|---|
DEFINE MEASURE and DESCRIPTION | The name and the description. |
AGGREGATE type ON field | The aggregation type and the value field (none when there is none). |
BY field | The base date field. |
GROUP BY field | The grouping field. Leave it out to not group. |
FILTER BY | The 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 button | What it does |
|---|---|
| Measure name | The name and the description. |
| Aggregation | The chosen aggregation type. |
| Related charts | How many charts use the measure. Click to see which. |
| Edit | Opens the measure. |
| Duplicate | Creates a copy, with a suffix in the name. Disabled while the cube has no chosen fields. |
| Delete integration measure | Deletes the measure. |
| Checkboxes | Select 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:
| Measure | Value field |
|---|---|
| Revenue | receita |
| Cost | custo |
| Target | meta |
| Gross profit | lucro_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
| Message | Cause and fix |
|---|---|
| Measure name must be at least 3 characters | Use a more descriptive name. |
| Measure name cannot be longer than 50 characters | Shorten the name. |
| Description cannot be longer than 200 characters | Shorten the description. |
| Aggregation type is required | Pick a type from the list. |
| Date field is required | Pick the base date field. |
| Date field must be of date type | The chosen field doesn’t have the date format. Adjust the format in Cube fields. |
| Value field is required for this aggregation type | Pick the value field, or switch to a count type. |
| Filter name is required, Filter field is required, Filter comparison is required, Filter value is required | Fill 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
- Use the measure in a chart with Build a dashboard and Chart editor.
- Create filters the reader controls on the dashboard with Filters.