Hi @svetla87 

You can follow below

  1. Create the metric view for MAX credit_limit per account/date (account_credit_limit).
  2. Aggregate with SUM at query time using SQL CTE or subquery pattern
-- Get MAX credit per account per day from metric view
WITH account_maxes AS (
  SELECT 
    month_id,
    time_key,
    account_id,
    MEASURE(account_credit_limit) as max_credit_limit
  FROM card_metric_view
  GROUP BY month_id, time_key, account_id
)
-- SUM across accounts to get monthly total
SELECT 
  month_id,
  SUM(max_credit_limit) as total_credit_limit
FROM account_maxes
GROUP BY month_id
ORDER BY month_id;