# Ranking

One common use of conditional formatting is to highlight the top/bottom N-ranked items in a report, which can help to quickly identify the most important or relevant items in the data.

Refer to [create rule](/planning-sheets/how-tos/adding-business-logic-and-formulae/5.-conditional-formatting/create-rule-basic-settings.md) to get started. Once the rule is created and you can see the **Conditional formatting** side panel, follow the steps below.

Choose **Ranking** in the **Format by** dropdown. You can see the options shown in the image below. Using the **Style** section, you can format text based on color/style, apply a background color, or select icons.

<figure><img src="/files/PkzLVKQENElzvACCHifA" alt=""><figcaption><p>Conditional formatting based on Top N ranking</p></figcaption></figure>

**STEP 1:** Let's apply icon-based formatting to the Top 3 variants based on Jan 2025 revenue. Update the highlighted properties as shown below and click **Apply**.

<figure><img src="/files/IM4G7TV8wG1rkS1y7SPo" alt=""><figcaption><p>Customizing the rule</p></figcaption></figure>

**STEP 2:** The top 3 categories based on Jan 2025 PY Revenue Recalc show an icon on the left and are highlighted in blue, as shown below.

<figure><img src="/files/6rv1jbGkb8dF8lo3Pobk" alt=""><figcaption><p>Conditional formatting applied based on Top N ranking</p></figcaption></figure>

**STEP 3:** You can also apply ranking based on **percentages.** In the image, the bottom 50% of variants based on Jan 2025 PY Revenue Recalc are highlighted in blue.

<figure><img src="/files/3wkB8g2wnJR1osLvHhPA" alt=""><figcaption><p>Conditional formatting for bottom 50% of variant</p></figcaption></figure>

**STEP 4:** You can apply conditional formatting for the top and bottom items using the **Both** option. In the image, conditional formatting has been applied for the top and bottom variants.

<figure><img src="/files/AJ2Ao3pLpLJ4rO0ZQUmX" alt=""><figcaption><p>Conditional formatting for top and bottom variants</p></figcaption></figure>

**STEP 5:** Let's create one more rule for highlighting the top 5 brands, i.e., the subtotal rows. Create a new rule and configure it as shown below. Click Apply.

<figure><img src="/files/N3n49iOmjv2ySh5NqkSw" alt=""><figcaption><p>Applying CF for brand based on Ranking</p></figcaption></figure>

**STEP 6:** Conditional formatting is not applied because it has been configured for **Values only.**

<figure><img src="/files/rqHVUCZ7s3XnUMRZjBTf" alt=""><figcaption><p>Conditional formatting for values</p></figcaption></figure>

**STEP 7:** Change the Row hierarchy levels to **Values and totals** and click Apply. Notice how the subtotals are updated.

<figure><img src="/files/HXRV8am0Rsj6ubzNrCul" alt=""><figcaption><p>Conditional formatting for values and totals</p></figcaption></figure>

#### **FAQs**

**Q1: Can I customize the ranking criteria and display options?**\
Yes. Plan allows you to define rankings based on a selected measure, choose top or bottom *N* values, and control how ranked items are highlighted using conditional formatting options.

**Q2: How does ranking handle dynamic data changes?**\
Ranking in Plan is dynamic when underlying data changes; rankings are automatically recalculated based on the defined criteria, ensuring accurate and up-to-date results.

**Q3: Does applying ranking affect report performance?**\
No. Applying ranking does not impact report performance, data refresh, or calculations.


---

# 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/adding-business-logic-and-formulae/5.-conditional-formatting/create-rule-basic-settings/ranking.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.
