# Create rules

You can create conditional formatting rules from scratch or modify rules generated by one‑click options to match your reporting requirements. Use conditional formatting to compare measures against fixed values, other measures, or user selections, or to apply calculations that dynamically adjust the formatting in your report. You can also define conditions based on dimension categories.

#### Configure conditional formatting rules for tables <a href="#configure-conditional-formatting-rules-for-tables" id="configure-conditional-formatting-rules-for-tables"></a>

You can add icons, set the font, or background color based on specified conditions. For example, you may need to highlight values or categories in red when the profit falls below a certain limit.

1. Click **Conditional Formatting > Create Rule**.
2. Rename the rule to make it easier to identify.
3. In **Apply to**, select the item to be formatted - row headers, rows, column headers, or measures.
4. When working with a row hierarchy, you can apply conditional formatting to child rows, parent rows, or both. Set **Row hierarchy levels** to **Values only** to apply formatting to child rows, **Totals only** to apply it to parent rows, or **Values and Totals** to apply it to both.
5. Set the formatting style to apply when the condition is satisfied.

* Set the font style to bold, italic, or underline. Click the caret icon, and then choose an underline color.

![](https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252F7Fj4x4Iy9Lgv4aELPxTi%252Fimage.png%3Falt%3Dmedia%26token%3D9eae5f39-bf6f-4efd-95de-84a4784cc5ef\&width=768\&dpr=3\&quality=100\&sign=4b0db354\&sv=2)

* Set the cell background color, font color, cell border, or a hatched cell background. Click the caret icons to choose the color.

![](https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FahRfyQkGCQUyUhbSWDaO%252Fimage.png%3Falt%3Dmedia%26token%3D73740244-08bf-4ff2-9572-b1cc545c162a\&width=768\&dpr=3\&quality=100\&sign=e2413d27\&sv=2)

* Display icons or text.

![](https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252F2kZB1uXtW2Gpakp3Qoqk%252Fimage.png%3Falt%3Dmedia%26token%3D193130f8-ed43-4ddb-81c4-ec501ddbe18d\&width=768\&dpr=3\&quality=100\&sign=96a13b26\&sv=2)

6. Set **Format by** to **Rules(If Conditions).** Additional options are enabled to enter the condition.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FdGNXNKFiXdtnuF1VkHJp%252Fimage.png%3Falt%3Dmedia%26token%3D6f72c738-47d2-4952-ba26-7c7179c8c0cc&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=33f8ef6d&#x26;sv=2" alt=""><figcaption></figcaption></figure>

#### Configure conditional formatting rules for charts and cards <a href="#configure-conditional-formatting-rules-for-charts-and-cards" id="configure-conditional-formatting-rules-for-charts-and-cards"></a>

The steps to create rules for charts and

1. In your KPI card or chart visual, go to **Data** > **Conditional Formatting > New Rule.**
2. In charts, if you have hierarchical data in your axis category, you can apply conditional formatting to child bars, parent bars, or both. Set **Rule for** to **Values only** to apply formatting to child rows, **Totals only** to apply it to parent rows, or **Values and Totals** to apply it to both.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252Fua4OsC28PcCsSbJeJGY7%252Fimage.png%3Falt%3Dmedia%26token%3D2f0addae-bc0a-4b80-a66c-fbdac4d39d88&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=2383f077&#x26;sv=2" alt=""><figcaption></figcaption></figure>

3. Set **Format by** to **Rules.** Additional options are enabled to enter the condition.

#### Applying rules to elements <a href="#applying-rules-to-elements" id="applying-rules-to-elements"></a>

Conditional formatting can be applied to individual elements such as charts, data labels, and axis labels, as well as card backgrounds and KPI titles. Select the element(s) from the **Impacts on** section.

When you set **Impacts on** to *Chart* or *Data label*, the **Apply to** option is enabled. Select the measure to which the rule should be applied.

Some examples of applying conditional formatting to individual elements are shown below.

* To apply dynamic formatting to charts, set **Impacts on** to **Chart**, then choose the color and bar fill style (solid, outlined, or hatched) that should be applied when the condition is met.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FT5ElYUHVFcPgWOPuWB5u%252Fimage.png%3Falt%3Dmedia%26token%3D5ba19484-154f-4432-9153-8c5c0100d808&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=6084dce&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* You can set a background color for cards when the specified rule is met. Select **Background** as the **Impacts on** option.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FWg5rEipWlJRF39jDVJcn%252Fimage.png%3Falt%3Dmedia%26token%3D22fe32e3-e2b3-42f9-85a7-6d32e9e9d588&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=d8d41e06&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* Change the title color by setting **Impacts on** to **Kpi Title**.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252F7FFvOo4RS6oc02UjbVPp%252Fimage.png%3Falt%3Dmedia%26token%3D720ba9b8-dc13-4c9e-8412-d620efddcc1e&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=849528e9&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* Just like charts, backgrounds, and titles, you can apply dynamic formatting to other elements using the **Impacts on** section.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FXP1prHJ4Zl4FW4VrLXhO%252Fimage.png%3Falt%3Dmedia%26token%3D097a9611-0f3f-4692-8cff-69234f90e651&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=605c349d&#x26;sv=2" alt=""><figcaption></figcaption></figure>

#### Define conditional formatting conditions <a href="#define-conditional-formatting-conditions" id="define-conditional-formatting-conditions"></a>

Go to Conditional Formatting > New Rule to configure a rule.

* Select **Number** and enter a value to compare your measure against a static threshold.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FLfJFPZNoOLGDbGJHdmIY%252Fimage.png%3Falt%3Dmedia%26token%3D618a84ae-4c94-46b2-88b2-cbfb780d3391&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=e468457c&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* Select **Value** and choose the second measure to compare two measures.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FyJ4lH4BKROFrCadOeYQ9%252Fimage.png%3Falt%3Dmedia%26token%3Dbb3f8c42-41cd-40a3-97d1-e817c623aca8&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=dc31faa&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* Apply calculations by using either numeric values or measures. To define a calculation, select **Formula** and specify the expression you want to apply. In this example, the cells are highlighted when the plan exceeds actuals by more than 2 million.

For charts and cards, select the **Calculation** option to define a formula.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FmyfPowKgvR1TtSipeTJ9%252Fimage.png%3Falt%3Dmedia%26token%3D858afe67-f913-46e3-80d8-7cb4844b10fd&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=cd9f16a4&#x26;sv=2" alt=""><figcaption></figcaption></figure>

* For tabular data, conditional formatting can also be applied in reading view. Choose **User selection** and specify the measures to compare the selected cell against. In this example, when a user selects an Actuals or Plan value, it is compared against other Actuals values, and the higher values are highlighted.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FkGx5Rm9CjLxvFAZG048F%252Fimage.png%3Falt%3Dmedia%26token%3D312c9be6-ad69-4396-bd3c-ebdee1a02d3c&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=9496aa07&#x26;sv=2" alt=""><figcaption></figcaption></figure>

When a user selects a cell, all other cells with values exceeding the selected value are automatically highlighted.

<figure><img src="https://inforiver.gitbook.io/fabric-plan-mslearn/~gitbook/image?url=https%3A%2F%2F2715773316-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXaNsuBB3HcAa0WUQhDTv%252Fuploads%252FpdDQMlMdACaVBkXBkJJX%252FUntitled%2520Project.gif%3Falt%3Dmedia%26token%3D9009d22c-2a4e-4bf8-9eb7-d68835c8986e&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=6de7b0ab&#x26;sv=2" 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/intelligence-sheets/how-tos/apply-conditional-formatting/create-rules.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.
