# Visual column inside visual measures

We have covered the different types of manual input columns that can be inserted in the report in the previous sections. We have also learned the steps to [insert calculated columns](/planning-sheets/how-tos/adding-business-logic-and-formulae/measures-and-columns/insert-calculated-columns.md), in the form of visual measures as well as visual columns.

In this page, we will look at a specific case where you can include a data input visual column to be referenced inside a visual measure formula.

Data fields like interest rates, discount rates, tax slabs, and foreign exchange rates might be common to all the column dimensions. Hence they would be created as visual columns and we might need to refer to them often in calculations. In such cases, you can reference those visual columns in visual measures using the **COLUMNS** prefix.

Let us consider the following example: a visual input column is included to specify a discount rate of 10%.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(1545).png" alt=""><figcaption><p>Visual Column - Discount%</p></figcaption></figure>

To calculate the new sale price, we can insert a formula measure.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(1546).png" alt=""><figcaption><p>Inserting formula measure</p></figcaption></figure>

In the formula, we need to refer to this visual column, **Discount*****%*** to calculate the discounted sale price. The visual column is referred to using the **COLUMNS** prefix identifier.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(1548).png" alt=""><figcaption><p>Visual column referred inside a visual measure</p></figcaption></figure>

Click **Create** and the result is shown below:

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(1549).png" alt=""><figcaption><p>Discounted Price</p></figcaption></figure>

{% hint style="info" %}
In the current edition, visual measures can only refer to **data input** visual columns and not calculated visual columns (formula columns).
{% endhint %}

### 2.1.3. Insert rows from Look-up Tables

You can also insert rows and their leaf categories from Lookup Tables.&#x20;

**STEP 1:** To pick and upload row categories from Lookup tables, navigate to 'Home' > 'Manage Rows' > 'Row Settings' > 'Insert Row Configuration' > 'Manage'.&#x20;

In the Insert Row Configuration pop-up, select **Options list from Lookup Tables** from the Type dropdown.

<figure><img src="/files/c9XfUVjmccGCFr1oZ0UI" alt=""><figcaption></figcaption></figure>

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(341).png" alt=""><figcaption><p>Options list from Lookup Table.</p></figcaption></figure>

**STEP 2:** The **Add options from Semantic model** window opens. In the **Table Connection** tab, select the workspace, semantic model and the table you need to connect to. Click **Next.**

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(342).png" alt=""><figcaption><p>Table Connection</p></figcaption></figure>

**STEP 3:** Go to the **Options configuration** tab and choose the column from the connected table that will be used as the option label. In the example below, we have chosen the column 'Category' from the table 'Contoso-Product'. This column's members will be used to populate the 'Categories' row level.\
\
**STEP 4:** You can optionally specify a filter if hierarchical data is involved, and you want to maintain the same structure in your reports. In the **Columns** dropdow&#x6E;**,** select the field based on which you need to filter the options. In this case, it is the Contoso - Product.SubCategory which can be used to identify the Category. Select the matching field from the visual (SubCategory) in the **Visual Column** dropdown.

Then click **Add**.

Because of this filter, when you insert a row and add a sub-category first, you will be prompted with the category to which it belongs.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(344).png" alt=""><figcaption><p>Options configuration</p></figcaption></figure>

{% hint style="info" %}
Configuring filter options is optional. By adding it, we ensure that the dropdown list for each category displays only the relevant sub-categories and vice-versa. For example, if you choose "Cellphones" as the category, only the sub-categories under "Cellphones" will be displayed, not other categories.

Similarly, when you choose a sub-category, you can add it only under the relevant category.
{% endhint %}

**STEP** **5: F**ollow the same steps from 1 to 4 for SubCategory dimension.

<div align="left"><figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(345).png" alt=""><figcaption><p>Options list from semantic model</p></figcaption></figure></div>

<div align="right"><figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(346).png" alt=""><figcaption><p>Options Configuration</p></figcaption></figure></div>

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(347).png" alt=""><figcaption><p>Configuration done</p></figcaption></figure>

Once the configuration is completed as shown in the image above, you can follow the steps in sections 2.1/2.2 to insert the configured row categories into your visual.

You will see the data from the semantic model in the Category and Sub Category dropdowns.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/insert%20rows%20semantic.gif" alt=""><figcaption><p>Insert rows from semantic model</p></figcaption></figure>

The rows are inserted as shown below:

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(348).png" alt=""><figcaption><p>Inserted rows</p></figcaption></figure>

{% hint style="info" %}
The base data in our visual may be from one table, but the options in the dropdown may be from a different table; in such cases, you can specify a join. For more information on using joins and filters, please refer to [this section](https://docs.fabricplan.com/planning-sheets/how-tos/adding-business-logic-and-formulae/pages/Z1YktABi2gOmdrc8a7K2#id-4.-using-joins-and-filters).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fabricplan.com/planning-sheets/how-tos/adding-business-logic-and-formulae/visual-column-inside-visual-measures.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
