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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
user01
Resolver I
Resolver I

Dynamic Index Based on Scatter Plot Filtering

I use DirectQuery to get two tables, asum and po. I use X and Y from asum to make a scatter plot. I also use asum and po to make two simple table visuals.

Scenario: I click on Options 2, 3, and 5 on the scatter plot (x-y cordinates: (179 ,2054) , (159 ,1605) , (232 ,1929)) . Then the asum table filters.

Goals:

1. I want to have a dynamic Index in asum where Options 2, 3, 5 have Index 1, 2, 3 respectively. (ie. The smallest Option filtered has Index 1, then next smallest has Index 2, etc.)

2. I want the po table to be filtered from the scatter plot selection so it only shows Options 2, 3, 5.

3. I want the po table to also have the same Index results as asum, but with duplicates.

(Desired results below)

Attempt:

I made the index with RANKX in asum. It seems to work.

 

 Rankasum = RANKX(
    ALLSELECTED(asum),
    CALCULATE(MAX(asum[Option])),, ASC
    )

 

Next, I tried to make a 1:Many relationship from asum[Option] to po[Option] and used a similar measure as above using the DENSE parameter. (I can remove the relationship if it is not necessary.)
For po table, the Index seems to work with no selection on the scatter plot, but does not work when Options are selected in the scatter plot. But the rows are filtered like I want.

For asum, a blank row is introduced with no selection, but seems to work when Options are selected in the scatter plot.

 

How can I can I achieve my goals above? I imagine RANKX is the way to go, but any other approach is appreciated.

Table asum

IDOptionXY
511031431
521792054
531591605
541611464
552321929

 

Table po

IDOptionValueLevel
511000
514001
515002
515002
5115003
521000
5224001
531000
534001
534001
535002
535002
535003
535003
5310004
541000
544001
544001
545002
545002
545003
545003
545004
545004
545005
551000
554001
554001
555002
555002
555003
555003
555004
555004
555005
555005

 

Desired asum

user01_0-1710468558090.png

 

Desired po

user01_1-1710468601074.png

 

 

 

1 REPLY 1
lbendlin
Super User
Super User

What do you mean by "index result"? Do you really need the rankx when you can sort by the Option column?

 

lbendlin_0-1710688548525.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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