How count each element

I have a table like this:
a
a
a
b
b
c

Is it possible to display such a list using a list-type virtual column in the same table?
a 3 50%
b 2 33%
c 1 16%

p.s. sorry for google translator)

Ideally, you’d have a separate table that contains only the distinct values, then you could use virtual columns to gather and present the desired stats.

If not that, add virtual columns for the desired stats to the existing table, then you’ll want a slice of the original table that uses a row filter expression similar to this to include only one row per distinct column value:

(
  [_ROWNUMBER]
  = MIN(
    SELECT(
      table[_ROWNUMBER],
      ([column] = [_THISROW].[column])
    )
  )
)

where table is the name of the table, and column is the name of the column containing the values you want to present.

3 Likes

Thank you very much!

1 Like