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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Juramirez
Resolver I
Resolver I

Filter Top N segmendted by another values

Hi all. I have a table with following data:

City

Worker ID

Orders

MX

1

10

COL

2

1

MX

3

2

US

4

3

MX

5

45

MX

23

5

MX

44

4

US

9

1

COL

8

2

COL

43

3

MX

22

55

MX

111

12

US

78

34

COL

49

47

US

98

90

MX

69

0

 

I want to show in a matrix visual the top 3 of Workers ID by Orders segmented by City (Top 3 MX, Top 3 US, Top 3 COL, etc...). The problem is that when I do the TOPN it shows the top 3 overall, not segmented by city.

 

Regards,

Julián

3 REPLIES 3
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Juramirez 

You may create a rank measure like below and use it in visual level filter.

Rank =
RANKX (
    FILTER ( ALL ( 'Table' ), 'Table'[City] = MAX ( 'Table'[City] ) ),
    CALCULATE ( SUM ( 'Table'[Orders] ) ),
    ,
    DESC
)

a1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-cherch-msft 

 

Thanks for your answer but that's not the result i'm looking for:

IMAGE.PNG

This is my measure:

image2.PNG

 

Regards,

Julián

Hi @Juramirez 

Could you share the .pbix for us to check or provide more sample data which could reproduce your scenario?You can upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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