web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

sum of a report layout field

(8) ShareShare
ReportReport
Posted on by 57
hello , anyone can guide me how to do the sum of this field ; the total of (total amount) i tried =Sum(IIF(Fields!Qty~to_Invoice.Value > 0,Fields!Qty~to_Invoice.Value * Fields!Unit_Price100.Value, 0)) and =Sum(Fields!Qty__to_Invoice.Value * Fields!Unit_Price100.Value)
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    99,724 Super User 2026 Season 1 on at
    Hi, Any error messages? Hopefully the information below can give you some hints.
     
    In addition, I personally recommend calculating in the Report Object and passing the result to the layout, rather than calculating on the layout file, which will be simpler.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,283 Super User 2026 Season 1 on at
    Yes, I agree with ZHU. Calculating in the Report Object and passing the result to the layout is simpler than performing the calculation directly in the layout file.
  • Suggested answer
    Nimsara Jayathilaka. Profile Picture
    4,950 Super User 2026 Season 1 on at
    To sum a calculated field like "Total Amount" which is the product of quantity and unit price in a Business Central RDLC or Word report layout, you need to perform the multiplication for each line and then sum the results over the dataset.
     
    To get the total sum of this calculated field across all lines, you should use the Sum function with the same calculation inside, like this:
    =(SUM(Field!Qty_to_invoice.Value)*SUM(Field!Unit_Price100.Value))
     
    if you can handle that logic in AL Report Side it will be the best practice
     
    Thanks
    Nimsara
  • Suggested answer
    Pallavi Phade Profile Picture
    5,456 Super User 2026 Season 1 on at
    Namaste 
     
    If you to show the sum of field in layout then there are several ways 
     
    1) Use Sum property in layout and add conditons ,. It will work if there are no grouping involved .
    2) To use Sum property for Group wise Records , You have to take group footer and use sum property
    Best Option is to calculate summation as per need in onaftergetrecord Trigger and check output in Report 
     
    If you feel answer is helpful , please verify the answer 
     
     
    Regards 
    Pallavi
  • Sahan Hasitha Profile Picture
    2,683 on at
    hi
    To sum a calculated field like Total Amount (Quantity × Unit Price) in Business Central reports, the best practice is to calculate it in AL on the report side, usually inside the OnAfterGetRecord trigger, and then expose the value to the dataset for easy summation in the layout. If you handle it only in the layout (RDLC/Word), you must use Sum(Fields!Qty_to_invoice.Value * Fields!Unit_Price100.Value) instead of multiplying two separate sums, since that would be incorrect. For simple totals without grouping, you can place the field in a footer and use the Sum property; for grouped data, use the group footer. However, calculating the total in AL ensures accuracy, reusability, and simpler layouts.
  • Suggested answer
    Sahan Hasitha Profile Picture
    2,683 on at
    hi
     
    Recommended best practice is to handle this calculation in the AL report logic rather than in the layout, as it ensures accuracy, simplifies the layout design, and provides better maintainability.
  • Suggested answer
    Rishabh Kanaskar Profile Picture
    6,219 Super User 2026 Season 1 on at
    Hi,
     
    In RDLC/Report Builder, to sum a calculated field:
    Create a calculated field in the dataset (e.g., LineTotal = Qty_to_Invoice * Unit_Price100).
    In the footer or total textbox, use:
    =Sum(Fields!LineTotal.Value)

    If you want to sum only when Qty_to_Invoice > 0:
    =Sum(IIf(Fields!Qty_to_Invoice.Value > 0, Fields!Qty_to_Invoice.Value * Fields!Unit_Price100.Value, 0))

    Ensure field names match exactly (no typos or invalid characters) and remove special symbols like ~ or __.
     
    Thanks
    Rishabh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,948 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,048 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 727 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans