# Locking Rule

During budgeting, forecasting, and allocations, you may need certain cell values to remain unchanged. In some cases, you may also want to prevent other users from editing or entering values in specific rows or columns. You can achieve this by configuring locking rules.

Locking rules let you define which cells should be preserved from edits during distribution and forecasting, ensuring that critical values stay intact. These rules can be applied to selected rows and columns.

1. Click on **Locking Rule** to open the side panel.

<figure><img src="/files/KeflzQ878gFCSTKonix0" alt=""><figcaption><p>Locking Rule</p></figcaption></figure>

2. **Configure the details for the rule:**

**2.1. Rule Name:** Enter a name for the rule you're going to configure.

**2.2. Apply to Measures:** Select the measures to which you want to apply the locking rule. You can choose from all measures, selected measures, all visual columns, or selected visual columns.

<figure><img src="/files/9MWvKQcAQXTzk1U63mzB" alt=""><figcaption><p>Apply to Measures</p></figcaption></figure>

* **All Measures:** The locking rule applies to **all visual measures**, including those already configured and those added later in the planning sheet. It covers both data input and forecast measures, whether they are visible or hidden, based on the selected rows and columns.
* **All Visual Columns:** The locking rule is applied to all visual columns, including those already configured and those added later in the planning sheet.
* **Selected Measures:** The locking rule is applied only to the selected measures.&#x20;
  * **Choose Measures:** Select the measures to which the rule will be applied.
* **Selected Visual Columns:** The locking rule is applied only to the selected columns.
  * **Choose Columns:** Select the columns to which the rule will be applied.

<div><figure><img src="/files/CCUH6hoacADbwFni7BEr" alt="" width="375"><figcaption><p>Choose Measures</p></figcaption></figure> <figure><img src="/files/cvpJUt5Wc45fMp298V2W" alt="" width="375"><figcaption><p>Choose Columns</p></figcaption></figure></div>

**2.3. Rule Type:** Here, you can change the rule to other types—distribution or min-max rule—if required.

**2.4. Apply to Children:** If you lock a parent cell at a specific level, selecting this box will also lock all of its child cells.

<figure><img src="/files/PMnYL1g45KIJSF40PUWW" alt=""><figcaption><p>Apply to Children</p></figcaption></figure>

**2.5. Rows Selection:** Select the rows where the rule should be applied. You can apply to all rows or custom rows.

<figure><img src="/files/1BUPrin7f2irEYIkxiIm" alt="" width="375"><figcaption><p>All or custom rows</p></figcaption></figure>

* **All Rows:** All rows in the selected measures are locked.
* **Custom:** This option allows you to lock specific rows by using the basic selection filter or advanced group filters.

**Selection:** In the 'Selection' filter type, select the required rows to lock. Double-clicking a parent row selects/unselects a row with all of its children. Click **Submit.**

<figure><img src="/files/JtPuD1Y7e5j3dhjHNFyh" alt=""><figcaption><p>Selection filter</p></figcaption></figure>

**Filter:** In this type, you can select the row dimensions using text conditions such as 'is', 'is not', 'starts with', 'ends with', etc.

<figure><img src="/files/eca2ZIQWzobsCCcyvSI4" alt="" width="375"><figcaption><p>Text filter</p></figcaption></figure>

* Click on **Add filter** to include more dimensions to filter.&#x20;
* Choose AND or OR to logically combine multiple filter criteria.
* Use the **Add group** option to combine multiple groups of filter criteria.

<figure><img src="/files/24GgoPIsINzTUfOE4FDj" alt=""><figcaption><p>Advanced group filter</p></figcaption></figure>

**2.6. Columns Selection:** Select the columns where the rule should be applied. You can apply to the entire open period, a specific period range, or a custom period.

* **Open Period:** Select this option to lock all columns in the open period.
* **Period Range:** Select a period range to lock.

<figure><img src="/files/KWQPkNSDy8aHcu4rNqgO" alt="" width="375"><figcaption><p>Period Range</p></figcaption></figure>

* **Custom:** Select specific columns to lock using the **basic selection filter** or **advanced** **group filters** along with logical AND/OR to choose the period.

**Selection:** In the 'Selection' filter type, select the required columns to lock. Double-clicking a parent column selects/unselects it with all of its children. Click **Submit.**

<figure><img src="/files/GDU2OMmAdwJaKofcGm8y" alt=""><figcaption><p>Selection filter</p></figcaption></figure>

**Filter:** In this type, you can select the required columns using conditions such as 'is', 'is not', 'starts with', 'ends with', etc.

* Click on **Add filter** to include more columns to filter.&#x20;
* Choose AND or OR to logically combine multiple filter criteria.
* Use the **Add group** option to combine multiple groups of filter criteria.

<figure><img src="/files/phhFtXUyUonWf2NJ6nXE" alt=""><figcaption><p>Advanced Filter </p></figcaption></figure>

**With all of the above customizations, you can lock specific rows, columns, and measures at a granular level.**

In the following example, we have applied a locking rule to only the forecast measure to the selected rows for the periods Q3 and Q4.

<figure><img src="/files/S4s37yKDxHQLShDdOROM" alt=""><figcaption><p>Locked rows and columns</p></figcaption></figure>

When the subtotal or grand total is updated, you will notice that the locked cells remain unaffected by any allocations. These locked cells are also not available for user input or editing.

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


---

# 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/7.-planning-budgeting-and-forecasting/allocation-rules-and-controls/locking-rule.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.
