I have calculated the `TOP 10` running total of a table and now want to get this in percentage for a pareto diagram, I have the following code:

```
WITH
CTE as
(
    SELECT 
       [nWordNr] as W, 
       [nBitNr] as B,
       SUM([tmTotals]) as total,
       COUNT(*) as Amount
    FROM Messages_History
    GROUP BY nWordNr, nBitNr
),
totAlarms as
(
    select 
    count([nWordNr]) as cnt
    FROM Messages_History
)
SELECT TOP 10 *, 
    SUM(total) OVER (ORDER BY total desc) * 1.0 / totAlarms.cnt as Running
FROM   CTE
ORDER BY total desc

```

When I want to use `totAlarms.cnt` to calculate the running percentage I get the following error:

```
The multi-part identifier "totAlarms.cnt" could not be bound.

```

How can I use `totAlarms.cnt` to calculate the running percentage.