Forum Discussion

user01's avatar
user01
Resolver I
2 years ago
Solved

Rank Based on Selected Data from Scatterplot

I have pulled some data via DirectQuery. The two tables are "asum" and "po". There is a one-to-many relationship from asum to po. I use asum to make a scatter plot. For example, if I query ID = 5, th...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi user01 ,

    Ashish_Mathur mentioned the relationships , and I will continue to add to it later in this section:

    Below is my table1:

    Below is my table2:

    The following DAX might work for you:

     

    Rank asum = 
    VAR SelectedOptions = SELECTEDVALUE('asum'[Option])
    RETURN
        RANKX(
         ALLSELECTED('asum'),
            CALCULATE(MAX('asum'[Option])),
            ,
            ASC,
            DENSE
        )
    
    
    Rank po = 
    VAR SelectedOptions = SELECTEDVALUE('po'[Option])
    RETURN
        RANKX(
            ALLSELECTED('po'),
           
           
            CALCULATE(MAX('po'[Option])),
            ,
            ASC,
            DENSE
        )
    

     

    The final output is shown in the following figure:

    Best Regards,

    Xianda Tang

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