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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Slycls
Frequent Visitor

TOPN + an others Value in the same Line Chart

hello,

I have a problem, I want to display on a line chart a TOPN (5 lines) from a table + a value (1 line) from the same table but filter on a particular column, I don't know how take it to display the 6 lines.
Thanks for your help

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Slycls ,

 

Try to create two measures like so:

Rank =
RANKX (
    ALLSELECTED ( 'Table' ),
    CALCULATE ( SUM ( 'Table'[turnover] ) ),
    ,
    DESC,
    DENSE
)
Rank Filter =
IF ( [Rank] <= 5 || MAX ( 'Table'[BRAND] ) = "Laboratoire CCD", 1 )

Icey_0-1645435682567.png

 

 

Best Regards,

Icey

 

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
tamerj1
Super User
Super User

Hi @Slycls 

can you provide sample input data of let's say 10 rows. Also what do you want to see if the the Top 1 row is also part of the Top 5 rows?

Here is an example, I would like to display in a line graph the TOP 5 brands + the brand "Laboratoire CCD" according to the segment chosen by the user. Indeed if "CCD Laboratory" is already in the TOP 5 do not display it. Thanks for your help.

 

Slycls_0-1644824096544.png

 

Icey
Community Support
Community Support

Hi @Slycls ,

 

Try to create two measures like so:

Rank =
RANKX (
    ALLSELECTED ( 'Table' ),
    CALCULATE ( SUM ( 'Table'[turnover] ) ),
    ,
    DESC,
    DENSE
)
Rank Filter =
IF ( [Rank] <= 5 || MAX ( 'Table'[BRAND] ) = "Laboratoire CCD", 1 )

Icey_0-1645435682567.png

 

 

Best Regards,

Icey

 

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

Slycls
Frequent Visitor

Hi @Icey ,

 

Perfect, thank you very much

amitchandak
Super User
Super User

@Slycls , refer if these can help

TOp N with Others
https://www.youtube.com/watch?v=UAnylK9bm1I
https://blog.gbrueckl.at/2019/05/power-bi-dynamic-topn-others-with-drill-down/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for your feedback, but this is not exactly my need.

I have a fact table and a product table (with name, brand, category, laboratory...), I would like to display in a graph the TOP 5 of all the brands and in addition the TOP 1 of the brand filter on the laboratory field. Depending on the user's choice, I always want to see the brand of a particular laboratory appear.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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