# Create visual hierarchies

With Plan, visual hierarchies in rows & columns can be created by selecting multiple items and grouping them. In the case of row grouping, the subtotal values are calculated automatically.

You can also create row groups automatically based on Conditional formatting - Classification.

## 1. Group columns

In the example below, the columns are to be grouped and named 'Revenue', 'Sales', and 'Profit' respectively.

{% hint style="info" %}
The group icon is greyed out until a row or column is selected.
{% endhint %}

**STEP 1:** Select the columns to be grouped as Revenue. In the 'Settings' tab, click on **Group icon** and enter a label. Click 'Apply'.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(196).png" alt=""><figcaption><p>Creating a custom measure group</p></figcaption></figure>

**STEP 2:** The column group gets created and it can be formatted using the 'Style' and 'Alignment' options as shown below.

<figure><img src="/files/g7oTRrVVeePSKh5Rv3Hc" alt=""><figcaption><p>Revenue - custom group is created</p></figcaption></figure>

**STEP 3:** The other groups can be created and formatted as shown.

<figure><img src="/files/ZCYnsIPDEvPw9gnlYfKT" alt=""><figcaption><p>Groups created</p></figcaption></figure>

**STEP 4:** Enable the **Column Group Expand/Collapse Icon** option from Appearance settings. You can expand and collapse column groups by clicking the ![](/files/2pdP3yNcwRx31n5LIyYw)icon that appears when you hover over the column group names.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(199).png" alt=""><figcaption><p>Expand/collapse column groups</p></figcaption></figure>

The values in the grouped measures will not be displayed when a group is collapsed. Herte the Revenue group is collapsed.

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

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

**STEP 5:** When you have column dimensions assigned and you want the group to be created across all dimensions, check the **Group Across Columns** option.

<figure><img src="/files/2DeaeGb9TNBj2YF3GNnL" alt=""><figcaption></figcaption></figure>

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(200).png" alt=""><figcaption><p>Group across columns option</p></figcaption></figure>

Notice how the Revenue group is created across all the column dimension categories.

<figure><img src="/files/7z11778HNHRIug3MBxE0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(201).png" alt=""><figcaption><p>Creating groups across column dimensions</p></figcaption></figure>

{% hint style="info" %}
Note: Group across columns cannot be enabled without column hierarchy.
{% endhint %}

## 2. Group rows

### 2.1. Manual grouping

a) On selecting a column or multiple columns, the 'Group' icon gets enabled. Select the rows to be grouped and click on '**Group**' in the 'Settings' tab. A popup opens. Enter the row group label and set the total position. Click 'Apply'.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/3.7.7%20Row%20groups.png" alt=""><figcaption><p>Row grouping - label and total position</p></figcaption></figure>

b) The measures are automatically aggregated under the Group name 'Most Sold', which can be formatted. The row groups can be expanded/collapsed using the expand/collapse button to view the group members.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/3.7.9%20Row%20groups%20(1).png" alt=""><figcaption><p>Row group - Most Sold is created</p></figcaption></figure>

### 2.2. Auto grouping

Conditional formatting has been covered in detail in [section 5](https://github.com/lumelinc/FabricPlanningDocs/blob/Dev/planning/adding-business-logic-and-formulae/5.-conditional-formatting). For the purposes of exploring auto grouping of rows based on classification, we'll just look at the settings in brief.

In this example, classification rules are applied to Gross Margin %. High/Medium/Low is displayed next to the Gross Margin % values based on the applied ranges.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/3.7.11%20Auto%20Row%20groups.png" alt=""><figcaption><p>Conditional formatting - Classification</p></figcaption></figure>

a) In the 'Settings' tab, click on 'Group' and select the 'Segmentation- Gross Margin %' option. Rows are automatically grouped as shown below.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/3.7.12%20Auto%20Row%20groups.png" alt=""><figcaption><p>grouping based on classification</p></figcaption></figure>

{% hint style="info" %}
Applying auto grouping removes any existing row groups.
{% endhint %}

## 3. Ungroup

### 3.1. Columns/Rows/Across Columns

To remove a Columns/Rows/Across Columns group, click on the 'delete' icon under the group icon.

In case of auto-grouped rows, select '**None**'.

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

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/3.7.16%20Remove%20column%20groups.png" alt=""><figcaption><p>Removing column group</p></figcaption></figure>

In the next section, we'll cover how to [pin rows and columns](/planning/working-with-lumel-epm/3.-basic-interactions/pin-rows-and-columns.md).

#### Resources

[Group rows or columns in table/matrix reports](https://inforiver.com/blog/general/group-rows-columns-matrix-powerbi/)


---

# 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/working-with-lumel-epm/3.-basic-interactions/create-visual-hierarchies.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.
