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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors