> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/use-harness-platform/harness-dashboards/dashboard-legacy/add-custom-fields.md).

# Add custom fields to custom dashboards

Dashboards provide the flexibility to add custom fields to the query. Using custom fields you can build new ad hoc custom dimensions and measures in Explore. Adding custom fields to the query allows to gain deeper insights into your data.

This topic talks about how to add custom fields (dimensions and measures) to your dashboard query and how to utilize them to improve the data analysis.

#### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* [Create Dashboards](/harness-platform/use-harness-platform/harness-dashboards/dashboard-legacy/create-dashboards.md)

#### Review: Scope of Custom Fields <a href="#review-scope-of-custom-fields" id="review-scope-of-custom-fields"></a>

Custom fields are a combination of first-class dimensions and predefined functions like concat, contains, case, and so on. They can't be used to pull data from any third party or external source.

#### Step: Add Custom Fields <a href="#step-add-custom-fields" id="step-add-custom-fields"></a>

To get started with the custom fields, you need to select an Explore for your tile.

1. Create a Dashboard. Go to [Step 1: Create a Dashboard](/harness-platform/use-harness-platform/harness-dashboards/dashboard-legacy/create-dashboards.md#step-1-create-a-dashboard).
2. Add tiles to your Dashboard. Go to [Step 2: Add Tiles to a Dashboard](/harness-platform/use-harness-platform/harness-dashboards/dashboard-legacy/create-dashboards.md#step-2-add-tiles-to-a-dashboard).
3. Select an Explore for your tile.
4. Give your tile a name. This will be the name of the tile on the dashboard.
5. In **Custom Fields**, click **Add**.![](/files/EspL2g8CLqudsyy10IQL)
6. You can create the following types of custom fields:
   * Custom Dimension
   * Custom Measure
   * Table Calculation
   * For more information, go to [Adding custom fields](https://cloud.google.com/looker/docs/custom-fields) in the GCP documentation.

#### Create Custom Dimension <a href="#create-custom-dimension" id="create-custom-dimension"></a>

Perform the following steps to create a Custom Dimension.

1. In **Custom Fields**, click **Add**, and then click **Custom Dimension**.
2. In **Edit custom dimension**, in **Expression**, enter the expression for your dimension. For supported functions and operators, go to [Functions and operators](https://docs.looker.com/exploring-data/creating-looker-expressions/looker-functions-and-operators).
3. (Optional) Select the format for your dimension.
4. In **Name**, enter a name for your dimension. The name will appear in Custom Fields to identify your dimension.![](/files/m50KyNzhnN2mNn5w8vGw)
5. Once you're done, click **Save**.
6. Once you have set up your query, click **Run**.
7. Click **Save** to save the query as a tile on your dashboard.

**Examples: Custom Dimension**

Let’s take a look at some of the custom dimension examples with the corresponding visualizations.

**Example 1: Filter Based on the String Data Type**

This custom field is a regex search on all cloud cost management accounts for the string `ce`. Any account, project, or subscription without this string is bucketed under **Others**. You can use custom fields to get more specific and granular data for your analysis.

```
case(when(matches_filter(${unified_table.aws_gcp_azure_account_project_subscription}, `%ce%`),   
  ${unified_table.aws_gcp_azure_account_project_subscription}),   
  "Others"  
)
```

![](/files/ROne49o64usMl4yoUBcE)

**Example 2: Group Resources Across Your Environment**

This example shows how you can group resources across your cloud environment.

```
case(  
  when(${unified_table.product} = "Amazon Simple Storage Service" OR ${unified_table.product} = "Cloud Storage", "Storage"),  
  when(${unified_table.product} = "Amazon DynamoDB" OR ${unified_table.product} = "Cloud SQL", "DB"),  
  when(${unified_table.product} = "Amazon Elastic Compute Cloud" OR ${unified_table.product} = "Compute Engine", "Compute"),  
  "Other"  
)
```

![](/files/Q2nTYEnPKPraXea56gvh)

#### Create Custom Measure <a href="#create-custom-measure" id="create-custom-measure"></a>

Perform the following steps to create a Custom Measure.

1. In **Custom Fields**, click **Add**, and then click **Custom Measure**.
2. In **Edit custom measure**, in **Field to measure** select the field for which you want to create measure. For example, Resource ID.
3. Select the **Measure type**. For example, **Count distinct** or **List of unique values**.
4. In **Name**, enter a name for your custom measure. The name will appear in Custom Fields to identify your measure.![](/files/667fZBmajTIlkP4P0zqb)
5. (Optional) You can add filters to further narrow the results.
6. Once you're done, click **Save**.
7. Once you have set up your query, click **Run**.![](/files/8HdI7yvb5b4SFlbTuTPf)
8. Click **Save** to save the query as a tile on your dashboard.

#### Use Table Calculation <a href="#use-table-calculation" id="use-table-calculation"></a>

Table calculations make it easy to create ad hoc metrics. They are similar to formulas that are found in spreadsheet tools like Excel. Table calculations appear as green columns in the data table, rather than as blue columns (dimensions) or orange columns (measures).

Table calculations can perform mathematical, logical (true/false), lexical (text-based), and date-based calculations on the dimensions, measures, and other table calculations in your query.

Perform the following steps to use Table Calculation for your custom fields.

In **Custom Fields**, click **Add**, and then click **Table Calculation**. For details, go to [Using table calculations](https://cloud.google.com/looker/docs/table-calculations) in the GCP documentation.
