Show percentage of total

How do I add a column showing percentage of each school type in this example?

Whenever I add a custom column to calculate the percentage, it always just shows the first row with % instead of the whole list with a percentage.

Hi @irene
Create a Custom Expression in the Summarize-section instead of creating a Custom Column:

Hi @flamber. Thanks for responding. I'm trying to add a 3rd column to that table to show the % for each row and the "Share" expression is only calculating one value at a time and returning the results, e.g. I'd have to enter the following one at a time in the Summarize field:

Share([SchoolType] = "Alternative") * 100
Share([SchoolType] = "Elementary") * 100

How do I just enter one formula so it calculate a new column showing the % for each row?

Here's a video of what I'm trying to do whichm might be clearer.

@irene Most databases doesn't have a simple way of doing this without sub-query or windowing.
Metabase currently cannot do windowing in the GUI, and sub-query would either require two questions if done in the GUI or you'll have to use SQL.

With SQL you would do something like this:

SELECT "SchoolType", count(*) AS "Count", count(*)/(SELECT count(*)::float FROM "School") AS "Percent"
FROM "School"

There's a request for making this much easier: - upvote by clicking :+1: on the first post

Thanks @flamber