# Format by Rules (If conditions) in conditional formatting

When creating conditional formatting rules, you can choose from three **Format by** options that determine how formatting is applied. This article explains the Rules (If conditions) format option in detail. Refer to [create rules in conditional formatting](/planning-sheets/how-tos/conditional-formatting/create-rules-in-conditional-formatting.md) to know about it.

### Format by Rules (If conditions)

In the **Format by** dropdown, select **Rules (If conditions)** to configure rule-based conditional formatting based on one or more logical conditions. Format cells using font styles, colors, borders, icons, or background highlights when specified conditions are met.

#### Configure formatting styles

In the **Style** section, define how data should appear when conditions are met:

* **Font style** – Apply bold, italic, or underline
* **Font color** – Change text color
* **Cell background** – Highlight cells with color
* **Borders** – Add custom borders
* **Icons or text** – Display indicators or symbols
* **Hide values** – Mask sensitive data when conditions are met

You can also:

* Align icons within cells
* Display only icons or text (hide values)
* Apply formatting to charts or labels where applicable.

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

#### Define rule conditions

Use the **Conditions** section to specify when formatting is applied. You can combine multiple conditions using **AND/OR** logic.

Each condition contains the following components:

| Setting          | Description                                                                                       |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| Measure or field | Select the measure or column to evaluate.                                                         |
| Operator         | Define the comparison logic, such as *Greater than*, *Less than*, or *Equal to*.                  |
| Condition type   | Specify the comparison source, such as **Number**, **Data selection**, **Value**, or **Formula**. |
| Value            | Enter the comparison value or select a reference.                                                 |

Supported condition types include:

* **Number** - Apply formatting based on numeric thresholds.
* **Data selection** - Reference another cell value dynamically.
* **Value -** Compare against another measure or column.
* **Formula** - Use expressions combining measures and values.
* **User selection** - Apply formatting dynamically based on runtime user interaction.

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

#### Nested conditions

Advanced conditional formatting can be done by selecting **Add Condition.**

* Add multiple conditions and combine them using **AND/OR** logic.
* Apply complex business rules across dimensions.

<figure><img src="/files/rYOKtTgKLIcTzS33zwOI" 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/conditional-formatting/create-rules-in-conditional-formatting/format-by-rules-if-conditions-in-conditional-formatting.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.
