# SETVALUE

The SETVALUE formula can be used to assign a value to a data input field. It can be used to set up approval workflows in Power BI.

#### Syntax <a href="#syntax" id="syntax"></a>

```javascript
SETVALUE(measure, value, row, column)
```

#### Arguments <a href="#arguments" id="arguments"></a>

measure - The value will be assigned to the field specified in this parameter. Required.

value - The value to be assigned. Required.

row - Use the ROW identifier to reference the current row or pass the row category. Optional.

columns - Use the COLUMN identifier to reference the current column or pass the column category. Optional.

#### Example <a href="#example" id="example"></a>

```
SETVALUE([Status], 'Approved')
//Assigns 'Approved' to the Status field

SETVALUE([Status], 'Approved', ROW.LEAVES, COLUMN.LEAVES)
//Assigns 'Approved' to the leaf rows and leaf columns
```

Data input dropdowns have an **On Change Formula** section where you can specify the actions to be triggered when a user selects an option. In this example, the ManagerApproval dropdown is set to 'Submitted' when the tax rate is changed:

<figure><img src="/files/FepCcD5j5LRvWDRvMAOD" alt=""><figcaption><p>Setting the dropdown value when the data input is changed</p></figcaption></figure>

The ManagerApproval automatically changes to 'Submitted' when the TaxRate field is changed.

<figure><img src="/files/FepCcD5j5LRvWDRvMAOD" alt=""><figcaption><p>The approval dropdown is automatically updated when the data input field is changed.</p></figcaption></figure>

Similarly, we can set up approval workflows by changing the DirectorApproval to 'Pending' when the manager approves. If the change is rejected by the manager, the status is automatically set to 'Rejected' in the DirectorApproval dropdown.

<figure><img src="/files/FepCcD5j5LRvWDRvMAOD" alt=""><figcaption><p>Using SETVALUE to create approval workflows</p></figcaption></figure>

The animation below shows a sample approval workflow:

<figure><img src="/files/FepCcD5j5LRvWDRvMAOD" alt=""><figcaption><p>Approval workflow created using SETVALUE</p></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/formula-syntax/scripting-functions/setvalue.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.
