> 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/documentation/plan/planning-sheets/how-tos/optimize-overview.md).

# Optimize overview

Use Optimize to find the input values needed to reach a target KPI, like revenue, margin, or cash, and to make what-if analysis easier by recalculating the required input changes. Optimize supports multivariate scenarios by adjusting multiple data input measures simultaneously to meet a target value for a selected result measure.&#x20;

The most common use cases for Optimize in planning include:

* **Revenue planning:** Determine the sales volume, average selling price, or product mix required to achieve a target revenue.
* **Profit margin optimization:** Calculate the changes in pricing, costs, or sales mix needed to reach a target gross or operating margin.
* **Expense budgeting:** Identify the reductions or reallocations across multiple expense categories required to meet a budget target.
* **Cash flow forecasting:** Determine the changes in collections, payments, or capital expenditures needed to achieve a target cash balance.

### Prerequisites

1. Set up the planning sheet with at least one data input measure. The data input measure is the independent variable. Optimize adjusts the data input measure to achieve a target value or maximize or minimize the objective value. Learn more about [numeric data input measures](/documentation/plan/planning-sheets/how-tos/adding-business-logic-and-formulae/measures-and-columns/insert-manual-input-columns/insert-manual-input-columns.md).

{% hint style="info" %}
Native measures from the semantic model can't be edited. To use native measures such as prior year profit or COGS, create copies of the native measures before running optimization. In the **Planning** ribbon, go to **Insert Column > Number**. Select **Copy from another series**. Select the native measure to copy.
{% endhint %}

In the following example, *Units Sold (Projection), COGS (Projection), and Revenue (Projection)* are the data input measures.

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

2. Add at least one formula measure to the planning sheet. The formula measure is the dependent variable. Optimize adjusts one or more independent variables to achieve a target, minimum, or maximum value for a dependent variable.

{% hint style="info" %}
Ensure the formula uses a data input or forecast measure. Optimize adjusts the data input values to meet the target. The data input measure acts as the input or driver that Optimize changes to reach the target.
{% endhint %}

* To insert a formula measure, in the **Planning** ribbon, go to **Insert Column** and select **Formula.** Enter a formula that uses the data input measures created in the previous step.

<figure><img src="/files/3phanN9a5ahHfPSPRDCf" alt=""><figcaption></figcaption></figure>

* Set **Row aggregation** and **Column aggregation** to **Formula** and select **Create.**

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

The following screenshot shows the data input and formula measures.

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

### Optimization modes

Optimize supports two modes:

* **Target-based optimization** calculates the input values required to achieve a specified target for a result measure.
* **Direction-based optimization** calculates the input values that maximize or minimize a result measure while honoring the defined constraints.

Both modes support multivariate optimization by adjusting one or more input measures simultaneously.

### Configure optimization thresholds

Constraints are essential in optimization because they ensure the solution is realistic and feasible. Without constraints, the optimizer may produce mathematically correct results that cannot be implemented in the real world. Constraints ensure the solution satisfies business rules and operational limits, such as budget caps, production capacity, or minimum staffing requirements.

* In manufacturing, to maximize profit, machine hours cannot exceed 500 hours, raw material is limited to 10,000 units, and production quantities cannot be negative.
* In budget planning, to minimize operating costs, department budgets cannot fall below mandatory spending levels; total headcount must remain above a minimum.
* In sales planning, to maximize revenue, sales discounts cannot exceed 20%; inventory availability limits the number of units sold.

**Range-based constraint:**

Specify a minimum and maximum value for each data input measure to constrain the optimization. During optimization, the recalculated values for each input measure remain within the specified range, ensuring that the resulting solution is both feasible and aligned with business requirements.

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

**Fixed-value constraint**

Apply a fixed-value constraint to a data input measure to keep its value unchanged during optimization. The optimizer adjusts the remaining input measures to achieve the specified objective while honoring the fixed constraint.

Suppose *Sales Price* and *Sales Volume* are the input measures, and *Revenue* is the result measure. Constrain *Sales Price* to $100 so it remains unchanged during optimization. The optimizer adjusts *Sales Volume* to achieve the target revenue while keeping the sales price fixed.

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

### Adjust parameters to achieve targets <a href="#adjust-parameters-to-achieve-targets" id="adjust-parameters-to-achieve-targets"></a>

If **Optimize** doesn't reach the target value, adjust **Strategy**, **Tolerance**, and **Number of iterations**, then run Optimize again.

<figure><img src="https://learn.microsoft.com/en-us/fabric/iq/plan/media/planning-how-to-optimize-input-values/optimize-parameters.jpg" alt=""><figcaption></figcaption></figure>

* **Strategy** controls the size of the adjustments made to the input value while trying to achieve the target. Lower values use smaller steps and can take longer to converge. Higher values use larger steps and can converge faster, but can overshoot.
* **Tolerance** defines the allowed error between the achieved value and the target value and determines how precise the Optimize result is. For example, the target Profit per Unit = 0.50. If the tolerance = 0.01, Optimize stops when the achieved value is between 0.49 and 0.51.
* **Number of iterations** sets the maximum number of times to repeat the optimization loop. In each iteration, Optimize performs these operations:

  1. Tries an input value.
  2. Calculates the result.
  3. Compares the result to the target value.
  4. Adjusts the input value based on the comparison.

  <figure><img src="https://learn.microsoft.com/en-us/fabric/iq/plan/media/planning-how-to-optimize-input-values/successful-optimize.png" alt=""><figcaption></figcaption></figure>


---

# 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/documentation/plan/planning-sheets/how-tos/optimize-overview.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.
