Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Milozebre
Helper V
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.

 

Capture1.PNG

 

Thank you

 

 

2 ACCEPTED SOLUTIONS

This is the closest I could get:
Screenshot_3.jpg

View solution in original post

v-lionel-msft
Community Support
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":

zz6.PNG

zz7.PNG

zz8.PNG

 

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.

 

 

View solution in original post

6 REPLIES 6
v-lionel-msft
Community Support
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":

zz6.PNG

zz7.PNG

zz8.PNG

 

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.

 

 

Hil @v-lionel-msft , 

 

Thank you very much for your reply. 

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

luapdoniv
Resolver II
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.

Hello @luapdoniv , 

 

Thank you for the reply. 

I want to see the same view like that.

If not, only the highlighted 🙂 

 

Thnak you in advance

 

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.Screenshot_1.png

 

This is the closest I could get:
Screenshot_3.jpg

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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