Forum Discussion
Create a Calculated Column using MAX value from another column of the same table
Hi everyone
I have the first 3 columns in this table (tblResources) and I need to create a calculated column (4th column)
| IdPerson | idResource | ResourceCost | MaxResourceCostbyPerson |
| Jhon | rss01 | 1000 | 2000 |
| Jhon | rss05 | 1999 | 2000 |
| Jhon | rss02 | 2000 | 2000 |
| Peter | rss01 | 5000 | 5000 |
| Peter | rss03 | 2500 | 5000 |
Wich Dax expression should i use to create the column MaxResourceCostbyPerson, every row should have the MAX value of ResourceCost for that IdPerson.
Hopefully someone can help me.
Rewards.
AvalBuroAdmin
Add a New Column to your Table:Column = CALCULATE( MAX(Table1[ResourceCost]), ALLEXCEPT(TABLE1,Table1[IdPerson]) )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
5 Replies
- FowmySuper User
AvalBuroAdmin
Add a New Column to your Table:Column = CALCULATE( MAX(Table1[ResourceCost]), ALLEXCEPT(TABLE1,Table1[IdPerson]) )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
- AvalBuroAdminRegular Visitor
Thanks, it worked.
- sunnyzagsFrequent Visitor
Hi,
I was working on something similar but in my case 2000 for the first person, I want to display 2000 only against it and not the other values which are not the greatest. Something like this.
dPerson idResource ResourceCost MaxResourceCostbyPerson Jhon rss01 1000 Jhon rss05 1999 Jhon rss02 2000 2000 Peter rss01 5000 5000 Peter rss03 2500
- AlexisOlsonSuper User
There are many ways to do this but here's one option:
MaxResourceCostbyPerson = CALCULATE ( MAX ( TableName[ResourceCost] ), ALLEXCEPT ( TableName, TableName[IdPerson] ) )- AvalBuroAdminRegular Visitor
Thanks so much. It worked.