> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/planning-tutorials/5-build-a-p-and-l-hierarchy-with-measure-model.md).

# 4 - Build a P\&L hierarchy with Measure Model

In this tutorial, you will build and configure a *Measure Model* by organizing native and formula measures into a hierarchical P\&L structure, then create two scenarios in the Tree layout and compare them to see the real-time impact of revenue growth and cost restructuring on Net Profit.

### Prerequisites

Before you start this tutorial, make sure to complete the first three tutorials:

* [Introduction to planning in Microsoft Fabric](/planning-tutorials/1-introduction-to-fabric-planning.md)
* [Allocations and collaboration](/planning-tutorials/2-allocations-and-collaboration.md)
* [Optimize input values](/planning-tutorials/3-optimize-input-values.md)

This tutorial uses the plan app and the Fabric SQL database you created in the previous tutorials.

### Configure a measure model

In this section, you set up the planning sheet and build a simple P\&L model using the Measure Model feature. Organize native measures into a parent-child hierarchy using formula measures to turn a flat list of inputs into a structured P\&L model.

1. In *Northwind\_FMCG\_Plan*, select **New Planning Sheet** in the **Home** ribbon. Enter *P\&L – Measure model* and select **Create**.
2. Configure the field assignments from the P\&L Measures table as follows:

| Field   | Value                                         |
| ------- | --------------------------------------------- |
| Rows    | Region hierarchy— Region → Cities             |
| Columns | Date hierarchy—Year, Quarter, Month           |
| Values  | All the measures from the P\&L Measures table |

3. Double-click each measure label and remove the "Sum of" prefix to improve readability. Select the three dots (⋮) next to *Avg Selling Price* in the **Values** field and select **Average** from the dropdown. This populates the average selling price instead of the summed value.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FQzveHp7IaI7fJx1dxBt3%2Fimage.png?alt=media&amp;token=1bbda480-b464-415c-824c-04e462bbcf9c" alt=""><figcaption></figcaption></figure>

4. Navigate to the **Model** ribbon and select **Measure Model**. The measure model canvas opens.
5. To create a formula measure for *Gross Revenue,* first drag *Sales Volume* and *Avg Selling Price* into the **Drop from measure list** section at the bottom of the canvas.
6. Select **Add Measure** > **Formula**. Name it *Gross Revenue* and enter the formula `[Sales Volume]*[Avg Selling Price]`. Select **Create**.

{% hint style="info" %}
Ensure the row and column aggregation type is set to Formula for all the formula measures you create.
{% endhint %}

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F26y3iCUq6DlD4y1LWTAO%2Fimage.png?alt=media&amp;token=cba920de-9b73-4c02-a56c-8254be4f1f86" alt=""><figcaption></figcaption></figure>

* *Gross Revenue* is added to the measure list.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FqFHayskyqcxPxbzFqe5C%2Fimage.png?alt=media&amp;token=97c42da8-c904-4ef3-bc32-0de6e9be9cc0" alt=""><figcaption></figcaption></figure>

7. Drag the new *Gross Revenue* measure onto the canvas. Drag the *Sales Volume* and *Avg Selling Price* onto the Gross Revenue row — the measures snap into place as children. Observe that *Gross Revenue* becomes the parent of *Sales Volume* and *Avg Selling Price*.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FPmeeNTakRjwSGxqZ8ZSs%2Fcreate-measure-hierarchy-gross-revenue.gif?alt=media&amp;token=fc83a77f-44cb-44cb-9868-c37169a0c119" alt=""><figcaption></figcaption></figure>

8. Drag *Discounts and Returns* onto the canvas. Follow the same steps to create a *Net Revenue* measure by using the formula `[Gross Revenue] – [Discounts and Returns]`.
9. Drag *Net Revenue* onto the canvas. Then drag Gross Revenue and Discounts and Returns under the Net Revenue row. Observe that *Net Revenue* becomes the parent of *Gross Revenue* and *Discounts and Returns*.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FN3g7bhNre1uKIv9s6q6e%2Fnet-revenue-hierarchy.png?alt=media&amp;token=04976f85-d149-404f-ba7d-fb4fb4fab845" alt=""><figcaption></figcaption></figure>

10. Create a formula measure for COGS by using the formula: `[Raw Material Cost]+[Labor Cost]+[Other Direct Exp]`. Drag the COGS measure onto the canvas.
11. Select *Raw Material Cost*, *Labor Cost*, and *Other Direct Exp*. From the **Insert Measure** dropdown, select **COGS**, then select **Insert**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F6g27KhNd5xYPmIGm4qWB%2Fimage.png?alt=media&amp;token=1ddb8994-48fe-48a5-8f27-b2af7b9afdd7" alt=""><figcaption></figcaption></figure>

The *COGS* measure becomes the parent of *Raw Material Cost*, *Labor Cost*, and *Other Direct Exp*.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Fyo6IaVDwop9hKnp8Wljq%2Fimage.png?alt=media&amp;token=3b0a5d5f-e850-4ff0-8c68-f4f761bfb8d3" alt=""><figcaption></figcaption></figure>

12. In the same way, create the following measures:

| Measure            | Formula                                                                       |
| ------------------ | ----------------------------------------------------------------------------- |
| Gross Profit       | `[Net revenue] – [COGS]`                                                      |
| Operating Expenses | `[Admin Expenses]+[Employee Expenses]+[R&D]+[Selling and Marketing Expenses]` |
| Net Profit         | `[Gross Profit] – [Operating Expenses]`                                       |

The final pnl hierarchy is shown in the following image:

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FgVNZ1W508lyP9rYkrwjB%2Ffinal-pnl-hierarchy.png?alt=media&amp;token=6c59ec89-778b-47ef-904d-61201cd5da56" alt=""><figcaption></figcaption></figure>

### View the P\&L Model

In this section, you will view the P\&L model in the Measures in Rows layout.

1. Select **Back to Home** at the top of the measure model canvas. In the **Planning** ribbon, select the **Layout** dropdown and select **Measures In Rows.**
2. Observe that the configured measure hierarchy is now displayed — a structured P\&L view of the calculated measures and their underlying components, replacing the flat list from the setup step.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Fr37uzrUKW2FQymUwheVx%2F6-measure-rows-layout.png?alt=media&amp;token=a36d8171-b30a-4cc9-bad9-bf015ed79310" alt="" width="563"><figcaption></figcaption></figure>

### Create best case and cost restructuring scenarios

In this section, you create two scenarios in the Tree layout — one to simulate revenue growth in *Sydney* and one to simulate restructuring costs in *London*.

#### Create best case scenario

In this section, you create a Best Case scenario in the Tree layout and simulate revenue growth in Sydney. The measure hierarchy updates in real time as you adjust each input.

1. In the **Planning** ribbon, select **Layout** and select **Tree**. The P\&L model displays in tree view, breaking down from the grand total through region and country with the measure hierarchy.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FmdMcfafHFWYLtWs3tqvj%2F7-pnl-hierarchy-tree-view.png?alt=media&amp;token=3938f3b4-2565-4dad-91ae-7fb27935e2d7" alt=""><figcaption></figcaption></figure>

2. Select **Display** in the **Tree View** ribbon. In the **Display Settings** side panel, turn off **Show Header KPI**.
3. Select **Create Scenario** and name it *Best Case.* Ensure that all measures from the semantic model are included in the series, and click **Create**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Fu07aOELiCQaBaTJHgevV%2Fcreate-scenario-option-tree-view.png?alt=media&amp;token=734d1b74-dffa-4aac-acbc-9f442d052fae" alt="" width="563"><figcaption></figcaption></figure>

4. Under the *Asia Pacific* region, select the *Sydney* card. The simulation dialog box opens.
5. In the *Measure Simulation* dropdown, simulate the following under *Gross Revenue*:

* Sales Volume: 5%
* Avg Selling Price: 2%
* Discounts and Returns: −5%

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FWxeCGUNTdSnl9CuxQVIT%2F9-scenario-simulations-sydney-region.png?alt=media&amp;token=993dd343-4fe4-4439-bd90-a5d4776a475b" alt="" width="375"><figcaption></figcaption></figure>

8. Close the simulation dialog. Observe that the *Sydney* card updates in real time — *Net Profit*, *Gross Profit*, and *Net Revenue* show the upward variance indicators as each input is adjusted. The *Asia Pacific* and the *All* cards also update to reflect the change.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FMgWTdmVPfCNBEcLIf4Wq%2F10-sydney-asia-pacific-all-card-updated.png?alt=media&amp;token=cae8b0fc-fb49-4914-b64a-620965d9a701" alt=""><figcaption></figcaption></figure>

#### Cost Restructuring scenario

In this section, you create a *Cost Restructuring* scenario and simulate reduced costs in *London*. This scenario lets you compare a cost-focused approach against the Best Case revenue-growth approach.

1. Select **Create Scenario** and name it *Cost Restructuring*, ensure that all measures from the semantic model are included in the series, and select **Create**.
2. Confirm you can see the new scenario in the bottom left. Under the *Europe* region, select the *London* card. The simulation dialog box opens. Select **Value**. Scroll down and simulate the following under COGS and Operating Expenses:

* Raw Material Cost: 400k
* Labor Cost: 150k
* Employee Expenses: 120k
* Selling and Marketing Expenses: 160k

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Fw4BIcCNN8SxiKTT9i0G0%2F11-cost-restructuring-updates.png?alt=media&amp;token=2528cc5c-a35c-4b7e-aaac-9cc296f76582" alt="" width="375"><figcaption></figcaption></figure>

3. Close the simulation dialog box. Select the down arrow on the *London* card and *Europe* cards. Observe that the cards update in real time — the full P\&L cascade is visible on the card, showing how the restructured cost inputs flow through COGS, Operating Expenses, Gross Profit, and Net Profit.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FBZaHXunrCblozM6lPcZU%2F12-simulation-updated-all-cards.png?alt=media&amp;token=2a0c55c8-0afa-49dc-bee8-764c54ccb7b3" alt=""><figcaption></figcaption></figure>

### Compare Scenarios

In this section, you compare the Best Case Scenario with the Cost Restructuring scenario by using the Compare Scenarios feature.

1. In the **Tree View** ribbon, select **Compare Scenario**.
2. Configure the comparison with the following settings:

* **Compare**: Best Case
* **With**: Cost Restructuring

3. Observe the variance columns — the compare view places both scenarios side by side at every level of the hierarchy, making the difference immediately visible between a revenue growth approach and a cost restructuring approach.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FsV3nngYw9QWallyQFX8I%2F13-compare-best-case-cost-restructuring-scenarios.png?alt=media&amp;token=699a7a38-45b5-4738-bfbf-844cef6ab470" alt=""><figcaption></figcaption></figure>

4. Click **Exit Compare** to return to the tree view.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fabricplan.com/planning-tutorials/5-build-a-p-and-l-hierarchy-with-measure-model.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
