# Find rows ( or only a certain column from those rows) which have highest value of a specific column

**URL:** <https://community.amazonquick.com/t/find-rows-or-only-a-certain-column-from-those-rows-which-have-highest-value-of-a-specific-column/9020>\
**Category:** Q&A\
**Tags:** calculations, quick-sight\
**Created:** [January 12, 2023, 12:06pm UTC](https://community.amazonquick.com/t/find-rows-or-only-a-certain-column-from-those-rows-which-have-highest-value-of-a-specific-column/9020 "2023-01-12T12:06:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eleri](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@Eleri](https://community.amazonquick.com/u/Eleri)\
**Post date:** [January 12, 2023, 12:06pm UTC](https://community.amazonquick.com/t/find-rows-or-only-a-certain-column-from-those-rows-which-have-highest-value-of-a-specific-column/9020/1 "2023-01-12T12:06:01Z")

</div>

Is it possible to achieve with a calculated measure? I’m able to do it in sql, but need the same in Quick Sight caluclated measure:

[select - SQL how to find rows which have highest value of specific column - Stack Overflow](https://stackoverflow.com/questions/3337469/sql-how-to-find-rows-which-have-highest-value-of-specific-column)

---

<div class="post-metadata">

**Author:** ![David\_Wong](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/david_wong/32/15630_2.png) [@David\_Wong](https://community.amazonquick.com/u/David_Wong)\
**Post date:** [January 12, 2023, 5:41pm UTC](https://community.amazonquick.com/t/find-rows-or-only-a-certain-column-from-those-rows-which-have-highest-value-of-a-specific-column/9020/2 "2023-01-12T17:41:44Z")

</div>

If you just need to show the value in a visual (e.g. in a table), you don’t need to create a calculated field. Using the example in the link you provided, put MYINDEX in the “Group by” field well, NAME in the “Value” field well and select “Max” as your aggregation.

If you want a max value which is independent of any visual, you can create a calculated field like this:  
maxOver({MYINDEX}, [{NAME}], PRE\_AGG)

Take a look at level-aware calculations in the documentation:

> **[Using level-aware calculations in Amazon QuickSight - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/level-aware-calculations.html)**
>
> Use level-aware calculations in an Amazon QuickSight analysis to insert a window or aggregate function into the order of evaluation.

---

<div class="post-metadata">

**Author:** ![gillepa](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/gillepa/32/3891_2.png) [@gillepa](https://community.amazonquick.com/u/gillepa)\
**Post date:** [January 20, 2023, 6:48pm UTC](https://community.amazonquick.com/t/find-rows-or-only-a-certain-column-from-those-rows-which-have-highest-value-of-a-specific-column/9020/3 "2023-01-20T18:48:03Z")

</div>

Hi @Eleri  
Did David’s solution work for you? I am marking his reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the Quick Sight Community Q&A Forum!
