Forum Discussion

lastnn30's avatar
lastnn30
Icon for Post Patron rankPost Patron
4 years ago
Solved

Finding the max salary

Hi I can create a table which shows Dept and Salary, then I can show the max Salary for each dept. After I found the max salary for each dept, can I show the name of person? In excel pivot table if ...
  • v-zhangti's avatar
    4 years ago

    Hi, lastnn30 

     

    It may be that you still need to use DAX in order to accomplish your needs.

    Measure:

    Max Salary Name =
    IF (
        SELECTEDVALUE ( tdEmployee[Salary] )
            = CALCULATE (
                MAX ( tdEmployee[Salary] ),
                FILTER (
                    ALL ( tdEmployee ),
                    [Department] = SELECTEDVALUE ( tdEmployee[Department] )
                )
            ),
        SELECTEDVALUE ( tdEmployee[Name] )
    )
    

    When you click on the highest Salary in each department, the name of the person is displayed.

     

    Best Regards,

    Community Support Team _Charlotte

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