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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DeepakBaberwal
New Member

How to show TOP N values based on the Latest value?

I have a line graph with X axis Year&Quarter, in Y axis Attrition % , and in legends 10 regions.

now let say in current year region 3 4 5 is having highest attrition %. i want to show only these three regions line graph.

in my graph it is showing the top 3 region in that particular year and quarter?

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @DeepakBaberwal

Create measures

Rank = RANKX(FILTER(ALL(Sheet4),[year]=MAX([year])),[sum],,DESC,Dense)

show top3 2018 = IF(MAX([year])<>2018,1,IF(MAX([year])=2018&&[Rank]<=3,1,0))

Assume [sum] is a measure to show Attrition % of each region in each year.

5.png

Then add [show top3 2018] in the Visual Level filter and apply "show item when value is 1"

 

Best Regards

Maggie

 

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @DeepakBaberwal

Create measures

Rank = RANKX(FILTER(ALL(Sheet4),[year]=MAX([year])),[sum],,DESC,Dense)

show top3 2018 = IF(MAX([year])<>2018,1,IF(MAX([year])=2018&&[Rank]<=3,1,0))

Assume [sum] is a measure to show Attrition % of each region in each year.

5.png

Then add [show top3 2018] in the Visual Level filter and apply "show item when value is 1"

 

Best Regards

Maggie

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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