
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First Sorted Value not working
Hi All,
I have a table and I want to find out which browser has maximum views.
Ex:
Browser Type Views
Chrome 100
Mozilla 50
IE 20
I'm using this formula to find: FirstSortedValue([Browser Type],-Aggr(Sum(Views),[Browser Type]),[Browser Type])
This formula is not working for some reason as KPI(working if used it in a table). However, if I remove the minus(-) sign, I'm getting IE as value.
I'm confused as to why this is not working. Please help.
Also, is there any alternative formula to use?
- Tags:
- kpi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try this :
=FirstSortedValue([Browser Type],-Aggr(Max(Views),[Browser Type]))
Taoufiq ZARRA
"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "
(you can mark up to 3 "solutions") 😉


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like you have an extra argument you shouldn't have; the third (optional) argument in FirstSortedValue is the rank but you're passing "[Browser Type]" which is not a number.
Try this:
FirstSortedValue([Browser Type],-Aggr(Sum(Views),[Browser Type]))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It did not work.
Same as before this is working without the minus(-) sign. I guess I need to know how to bring in the last value(rank) in the 3rd Argument.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ideally below expression should work as expected
=FirstSortedValue([Browser Type],- Aggr(sum(Views),[Browser Type]))
But, You can try below as well.
1) =Only({<[Browser Type]={"=rank(sum(Views),0,4)=1"}>}[Browser Type])
2) = aggr(if(max( total aggr(sum(Views),[Browser Type]))=sum(Views),[Browser Type]),[Browser Type])
Note: Try to use set analysis expression first instead if.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have multiple Browsers where Views have the same max value? If that is the case, then which one would you want to see? All of them or randomly one?
For Randomly one, try this
FirstSortedValue(DISTINCT [Browser Type], -Aggr(Sum(Views), [Browser Type]))
For displaying multiple values separated by comma
Concat(Aggr(If(Sum(Views) = Max(TOTAL Aggr(Sum(Views), [Browser Type]), [Browser Type]), [Browser Type]), ', ')
