cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper V

How to see the top 3 and the bad 3

Hello Community,

Is it possible to see in a column like below The 3 best and the 3 worst with.

Thank you

2 ACCEPTED SOLUTIONS
Resolver II

This is the closest I could get:

Community Support

Hi @Milozebre ,

Try to do like this:

1. creating a calculated column:

``````Rank =
RANKX(
'Sheet1 (2)',
[quantity],
, ASC, Dense
)``````

2. creating a measure:

``````Color =
VAR x =
CALCULATE(
MAX([Rank]),
ALL('Sheet1 (2)')
)
RETURN
IF(
MAX([Rank]) >= 1 && MAX([Rank]) <= 3,
"red",
IF(
MAX([Rank]) <= x && MAX([Rank]) >= x-2,
"green"
)
)``````

3. adding the measure to "Conditional formatting->Background color":

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 REPLIES 6
Community Support

Hi @Milozebre ,

Try to do like this:

1. creating a calculated column:

``````Rank =
RANKX(
'Sheet1 (2)',
[quantity],
, ASC, Dense
)``````

2. creating a measure:

``````Color =
VAR x =
CALCULATE(
MAX([Rank]),
ALL('Sheet1 (2)')
)
RETURN
IF(
MAX([Rank]) >= 1 && MAX([Rank]) <= 3,
"red",
IF(
MAX([Rank]) <= x && MAX([Rank]) >= x-2,
"green"
)
)``````

3. adding the measure to "Conditional formatting->Background color":

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helper V

Hil @v-lionel-msft ,

Its perhaps a stupid question but what's "sheet1 (2)"

Resolver II
Can you please confirm you want to see them highlighted or only see the top3 and bottom3 there ignoring the rest of the data rows.
Helper V

Hello @luapdoniv ,

I want to see the same view like that.

If not, only the highlighted 🙂

Resolver II

This is the closest I could get.
Highlight top 3 values by conditional format as background color and highlight bottom 3 values by conditional format as font color
OR
Highlight top 3 values by conditional format as background color and highlight bottom 3 Names by conditional format as background color

Will continue R&D to see if your requirement can be achieved. Let me know if this helps.

Resolver II

This is the closest I could get:

Announcements

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors