Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Getting value in a different column by filtering and max

Hi Everyone,

 

I am trying to get the staff name for different category, based on max total training hours.

 

Eg. Expected result = Staff A, after i filter Cat 1 and MAX of total training hours

and expected result = Staff B, after i filter cat 2 and MAX of total training hours.

 

Planning to put the measure results in different cards.

 

StaffCategoryTotal Training Hours
Staff A13
Staff B22
Staff C11
  • Hi, Anonymous 

    I am not sure whether I understood your question correctly, but check the below.

     

     

    https://www.dropbox.com/s/hm87mfz1ektwp1z/myhyasin.pbix?dl=0 

     

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

6 Replies

  • Anonymous , Try a measure like

     

    maxx(values(Table[Staff]),calculate(sum(Table[Training Hours])))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amitchandak , I tried this too but what about the filter for the category?

      • Anonymous's avatar
        Anonymous
        Not applicable

        This will also return the training hours but i want it to return the name of staff

  • Hi, Anonymous 

    Please check the below picture and the sample pbix file's link down below.

     

     

    Result Measure =
    VAR maxtraininghours =
    CALCULATE ( MAX ( 'Table'[Total Training Hours] ), ALLSELECTED ( 'Table' ) )
    RETURN
    CALCULATE (
    MAX ( 'Table'[Staff] ),
    FILTER (
    ALLSELECTED ( 'Table' ),
    'Table'[Total Training Hours] = maxtraininghours
    )
    )
     
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, to be clear, i need a measure which returns me the staff name based on the values below.

    1) MAX total training hours

    2) category 1 or 2

     

    They will be put in separate cards.

     

    Means in one card - result is staff A and in another card - result is staff B

    • Jihwan_Kim's avatar
      Jihwan_Kim
      Icon for Super User rankSuper User

      Hi, Anonymous 

      I am not sure whether I understood your question correctly, but check the below.

       

       

      https://www.dropbox.com/s/hm87mfz1ektwp1z/myhyasin.pbix?dl=0 

       

       

      Hi, My name is Jihwan Kim.

       

      If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

       

      Linkedin: linkedin.com/in/jihwankim1975/

      Twitter: twitter.com/Jihwan_JHKIM