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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

I have a measure, I need to display top 2 customers lines and 1 line for selected customer.

I have a measure and I need to display it in a line chart.
I need to display the top 2 customers lines and 1 line for the selected customer.  Below is the image of how I am looking. Can anyone help?

Ravi_BI_0-1650641175401.png

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

Try formulas as below:

Selected_CustomIDs = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[CustomerID] in VALUES('slicer'[CustomerID]) ))
Other_CustomIDs = CALCULATE(SUM('Table'[Value]),FILTER('Table',NOT 'Table'[CustomerID]  in VALUES('slicer'[CustomerID]) ))

 

1.png

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

Please try some formulas like below:

1.add a rank calculated column in your original table

Rank = RANKX('Table',CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[CustomerID])),,DESC,Dense)

 2.add a seperate table as slicer

Rank = RANKX('Table',CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[CustomerID])),,DESC,Dense)

3.add a mesaure as below and apply it to visual filter pane

filter control =
VAR a =
    //if slicer is not selected
    IF (
        MAX ( 'Table'[CustomerID] )
            IN VALUES ( slicer[CustomerID] )
                || MAX ( 'Table'[Rank] ) IN { 1, 2 },
        1,
        0
    )
VAR b =
    //if slicer is not selected
    IF ( MAX ( 'Table'[Rank] ) IN { 1, 2 }, 1, 0 )
RETURN
    IF ( ISFILTERED ( 'slicer'[CustomerID] ), a, b )

9.png

Best Regards,
Community Support Team _ Eason

 

Anonymous
Not applicable

Hi @v-easonf-msft , 

Thank you for your solution.
its working perfect but I am facing one more issue I have two different measure in the same table
1 measure only 1 customer other measure for all other customers  and Total measures

in this case do we have any solution?



 

Hi, @Anonymous 

Try formulas as below:

Selected_CustomIDs = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[CustomerID] in VALUES('slicer'[CustomerID]) ))
Other_CustomIDs = CALCULATE(SUM('Table'[Value]),FILTER('Table',NOT 'Table'[CustomerID]  in VALUES('slicer'[CustomerID]) ))

 

1.png

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors