Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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?
Solved! Go to 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]) ))
Best Regards,
Community Support Team _ Eason
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 )
Best Regards,
Community Support Team _ Eason
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]) ))
Best Regards,
Community Support Team _ Eason
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.