Forum Discussion
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.
| Staff | Category | Total Training Hours |
| Staff A | 1 | 3 |
| Staff B | 2 | 2 |
| Staff C | 1 | 1 |
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
- amitchandak
Super User
Anonymous , Try a measure like
maxx(values(Table[Staff]),calculate(sum(Table[Training Hours])))
- AnonymousNot applicable
Hi amitchandak , I tried this too but what about the filter for the category?
- AnonymousNot applicable
This will also return the training hours but i want it to return the name of staff
- Jihwan_Kim
Super User
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' ) )RETURNCALCULATE (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
- AnonymousNot 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
Super 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