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! Request now

Reply
jayasurya_prud
Helper II
Helper II

To display preceding and succeeding values from the slicer selection

I am working on a problem statement. Where I am creating a map and tables and slicers for filters. 

 

Let's say that my fields are

 

city city idcustomers countsalesprofitcategory

 

in power bi, I am creating a map visual, where the city will be pointed and customers count, sales, profit will be mentioned as tooltip.

 

What I am trying to do is, lets say there are 10 categories and each category has 20 records/cities. 

 

What i want is, if I select a particular record/city, only the preceding 5 records/cities in the data and succeeding 5 records/cities in the data should be appeared in the map and the table,  along with the city that I selected in the slicer.  (like preceding and unbounded following in sql). 

 

Please help me with the solution. For more clarity, reply your questions. 

 

 

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

Hi @jayasurya_prud ,

 

This is my test table:

vyadongfmsft_0-1665647463782.png

 

Create a new column:

Rank = RANKX(FILTER('Table','Table'[City] = EARLIER('Table'[City])),'Table'[Profit],,ASC,Dense)

vyadongfmsft_1-1665647622225.png

 

Add [Rank] column to filters and filter data like below shown:

vyadongfmsft_3-1665647765553.png

 

Then you can show the preceding 5 records/cities in the data and succeeding 5 records/cities in the data.

vyadongfmsft_4-1665647797808.png

Best regards,

Yadong Fang

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

1 REPLY 1
v-yadongf-msft
Community Support
Community Support

Hi @jayasurya_prud ,

 

This is my test table:

vyadongfmsft_0-1665647463782.png

 

Create a new column:

Rank = RANKX(FILTER('Table','Table'[City] = EARLIER('Table'[City])),'Table'[Profit],,ASC,Dense)

vyadongfmsft_1-1665647622225.png

 

Add [Rank] column to filters and filter data like below shown:

vyadongfmsft_3-1665647765553.png

 

Then you can show the preceding 5 records/cities in the data and succeeding 5 records/cities in the data.

vyadongfmsft_4-1665647797808.png

Best regards,

Yadong Fang

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

 

 

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.

Top Solution Authors