Forum Discussion

sonny's avatar
sonny
Regular Visitor
9 years ago
Solved

Ranking a value based on columns from different tables

Hi,

 

I am a new user to Power BI Desktop and wondered how I rank a 'Total' value that I have in table1, which is ranked by a 'Job Title' column which is in table2? There is a relationship between the 2 tables which is based on an employee number column.

 

Would I build he measure/column in table 1 or am I better off creating this in a new clean table3?

 

Thanks

Sonny

  • Hi sonny,

     

    According to your description, I create some sample data and create a calculated column in Table 1 use Rankx() function to rank the Total values based on Job Title. See:

     

    Rank = RANKX(Table1,RIGHT( RELATED(Table2[Job Title]),1))

     

     

    If above DAX doesn't meet your requirement, please share same sample data and expected results for our analysis.

     

    Best Regards,
    Qiuyun Yu

2 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Icon for Community Support rankCommunity Support

    Hi sonny,

     

    According to your description, I create some sample data and create a calculated column in Table 1 use Rankx() function to rank the Total values based on Job Title. See:

     

    Rank = RANKX(Table1,RIGHT( RELATED(Table2[Job Title]),1))

     

     

    If above DAX doesn't meet your requirement, please share same sample data and expected results for our analysis.

     

    Best Regards,
    Qiuyun Yu

    • sonny's avatar
      sonny
      Regular Visitor

      Thats great, thanks Qiuyan.