OPTIMIZE OpenBI
A plan in use, solved again with other values for its parameters: its rows with the decisions of the new solution, for a what-if.
Group: Operations research. OpenBI’s own: DAX has no function of this name.
Syntax
OPTIMIZE ( <name> [, <parameter>, <value>] … )
| Parameter | Type | Description |
|---|---|---|
name | Text | The plan's name: the Operations Research notebook it was saved from. |
parameter | Text optional, repeatable | The name of one of the plan's parameters, such as a capacity or a demand. Not case-sensitive. |
value | Number optional, repeatable | The value that parameter takes in this solve. |
Returns
Table. The plan's own rows and columns, as its version saved them, with the decision columns (such as the liters to bottle) filled in from the new solution.
Remarks
- A plan is an Operations Research notebook's model saved as a version: what it decides, what it maximizes or minimizes, its limits, and which of the limits' numbers are parameters. Only a version approved and put in use is solved; a name with none in use is an error.
- Parameters come in pairs, a name and then its value; a parameter left out keeps the value it was saved with, so
OPTIMIZE ( "Production plan" )is the plan as approved. An unknown name, a value that is not a number, or a name without its value is an error. - The model is solved again as a linear or mixed-integer program with HiGHS, for at most a minute. Decisions that must be whole numbers come back rounded.
- Values that leave no plan meeting every limit, or nothing that limits the objective, make the call an error rather than an empty table.
- The same values asked again are answered at once with the same plan, so a slider that comes back to a value shows what it showed before.
- A what-if page made from the plan (What-if page, on the notebook's Model tab) uses it: its sliders give the values. Workspace Viewers, and anyone else who reads the model through one of its roles, get an error: the plan was solved over the whole model, rows a role would hide included.
Compared with DAX
An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.
Examples
The production plan with Bergen bottling 10 % more
The Example Brewery as it ships has no plan in use (its Production plan example becomes one only once a person approves a version), so here the query is an error. With a plan in use whose parameters include Bergen hours, it returns the plan's rows with the liters solved again.
EVALUATE
OPTIMIZE ( "Production plan", "Bergen hours", 1760 )
Result: an error.