• Have you tried aggregating the bills in isolation from the rest of the query? Here's one way which looks clean and performs quite well:

    SELECT

    p.period

    ,m.clnt_matt_code AS [Client Code]

    ,m.matter_name

    ,o.offc_desc

    ,'Insolvency' AS matter_code

    ,ISNULL(l.Merged_Source_of_Work_Lender_Desc,k.name) AS Bank

    ,CASE WHEN m.matter_code NOT IN ('IBR','ISR','BNK','ADV')

    THEN ISNULL(mins.original_estimated_fee,0) + ISNULL(mins.original_contingent_fee,0)

    ELSE 0

    END AS [Original Fee]

    ,isnull((

    Select top 1 'Y'

    from bo_live5.dbo.hba_source_bus AS ii

    where ii.matter_uno=i.matter_uno and ii.comments LIKE '%walk-in%'

    ),'N') AS [Walk In],

    em.employee_name,

    isnull(x.billings_to_date, 0) AS billings_to_date

    FROM bo_live5.dbo.hba_source_bus AS i

    INNER JOIN bo_live5.dbo.cxa_folder_object AS j ON i.fo_uno = j.fo_uno

    INNER JOIN bo_live5.dbo.hbm_name AS k ON k.name_uno = j.object_uno

    LEFT JOIN BO_Custom.dbo.Source_of_work_Lender l ON l.Original_Source_of_Work_Lender_Desc = k.name --improtu look up for banks that have merged

    INNER JOIN bo_live5.dbo.hbl_name_class AS h ON k.name_class_code = h.name_class_code

    INNER JOIN bo_live5.dbo.hbm_matter AS m ON m.matter_uno = i.matter_uno

    INNER JOIN bo_Live5.dbo.hbm_PERSNL AS em ON em.empl_uno = m.resp_empl_uno

    --INNER JOIN bo_Live5.dbo.BLT_BILLM AS bi ON bi.matter_uno = m.matter_uno

    CROSS APPLY (

    SELECT billings_to_date = sum(bi.PROGRESS_BIL + bi.HARD_BIL + bi.SOFT_BIL + bi.FEES_BIL + bi.OAFEE_BIL + bi.RETAINER_BIL + bi.PREMDISC_BIL - bi.CREDIT_TOT)

    FROM bo_Live5.dbo.BLT_BILLM bi

    WHERE bi.MATTER_UNO = m.MATTER_UNO

    ) x

    INNER JOIN bo_live5.dbo.hbl_office AS o ON o.offc_code = m.offc

    INNER JOIN bo_live5.dbo.hba_offc_prof c ON c.offc = o.offc_code

    AND LEFT(c.prof,2) IN (SELECT FieldName FROM dbo._000007_SplitList(@Profit_Center,',' ))

    INNER JOIN CTE_Mins AS mins ON mins.matter_uno = m.matter_uno

    LEFT JOIN bo_live5.dbo.glm_period_end AS p ON m.open_date BETWEEN p.per_begin_date AND p.per_end_date + '23:59:59'

    WHERE ....................(Intentionally removed to reduce code)

    --GROUP BY p.period

    --,m.clnt_matt_code

    --,m.matter_name

    --,o.offc_desc

    --,ISNULL(l.Merged_Source_of_Work_Lender_Desc,k.name)

    --,m.matter_code

    --,mins.original_estimated_fee

    --,mins.original_contingent_fee, i.matter_uno ,em.employee_name

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden