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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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