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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Oros
Post Prodigy
Post Prodigy

Top Items (Comparison / Lookup)

Hello,
 
I have a TOP N with measures to rank by sales ($) each product. It can rank as COMPANY-wide or per Salesperson (like BOB).
 
Oros_0-1719331612250.png

 

 
What would be the correct measure or column to add to show that Bob is missing out on the top item/s of the COMPANY?  
 
In the example below, I would like to show that Bob is NOT selling Apple and Strawberry.  In other words, I would like to show what items are NOT in Bob's list compared to COMPANY.  Thanks.
 
 
Oros_1-1719331612250.png

 

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Oros ,

The Table data is shown below:

vzhouwenmsft_0-1719366760554.png

vzhouwenmsft_1-1719366773127.png

Please follow these steps:

1. Use the following DAX expression to create a column in table 'BOB'

Rank = RANKX('BOB',[Sales],,DESC,Skip)

2.Use the following DAX expression to create a column in table 'COMPANY'

Rank = RANKX('COMPANY',[Sales],,DESC,Skip)

3.Use the following DAX expression to create a measure

Measure = 
VAR _Top5_BOB = SELECTCOLUMNS(FILTER('BOB','BOB'[Rank] <= 5),"Top 5",[Product])
VAR _Top5_COMPANY = SELECTCOLUMNS(FILTER('COMPANY','COMPANY'[Rank] <= 5),"Top 5",[Product])
VAR _Result = ADDCOLUMNS(_Top5_COMPANY,"samewithBOB",IF([Top 5] IN _Top5_BOB ,BLANK(),[Top 5]))
RETURN CONCATENATEX(FILTER(_Result,[samewithBOB] <> BLANK()),[samewithBOB],",")

4.Final output

vzhouwenmsft_2-1719366946187.png

 

Best Regards,
Wenbin Zhou
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

2 REPLIES 2
Anonymous
Not applicable

Hi @Oros ,

The Table data is shown below:

vzhouwenmsft_0-1719366760554.png

vzhouwenmsft_1-1719366773127.png

Please follow these steps:

1. Use the following DAX expression to create a column in table 'BOB'

Rank = RANKX('BOB',[Sales],,DESC,Skip)

2.Use the following DAX expression to create a column in table 'COMPANY'

Rank = RANKX('COMPANY',[Sales],,DESC,Skip)

3.Use the following DAX expression to create a measure

Measure = 
VAR _Top5_BOB = SELECTCOLUMNS(FILTER('BOB','BOB'[Rank] <= 5),"Top 5",[Product])
VAR _Top5_COMPANY = SELECTCOLUMNS(FILTER('COMPANY','COMPANY'[Rank] <= 5),"Top 5",[Product])
VAR _Result = ADDCOLUMNS(_Top5_COMPANY,"samewithBOB",IF([Top 5] IN _Top5_BOB ,BLANK(),[Top 5]))
RETURN CONCATENATEX(FILTER(_Result,[samewithBOB] <> BLANK()),[samewithBOB],",")

4.Final output

vzhouwenmsft_2-1719366946187.png

 

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

 

Hi @Anonymous,

 

Thank you so much.  This works!!!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.