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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to Group and then Combine Rows in AL or in SSRS?

(0) ShareShare
ReportReport
Posted on by 481

Say I have a table with columns: Item | Cost | Quantity | Total

How would I group rows by items, and THEN calculate the combined Cost and Quantity?

Example:
row1: Bike, $100, 1, $100
row2: Bike, $100, 2, $200
row3: Tire,    $30, 1, $30

Would be combined like this (since there are two Bike items, we combine them and get the new total):
row1: Bike, $100, 3, $300
row2: Tire,    $30, 1, $30

Is this easier to implement in AL or in an SSRS report builder? I am ultimately trying to display this table in a report.

Thanks!

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    You can do it in AL. But i really think that what you should do is to look at Power BI to solve this. Especially if you are running BC Online.

  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at

    Hi, it can be done in SSRS, but it looks more complicated. Use Bike(Item No?) to create a new Group, but the Unit Price looks like an average, and the Quantity and Amount look like a total.

    So, I think the easiest way is to handle it in AL.

    A simple practice: create a temporary table and add the fields you need. Then use this new table to create a new Report. Then insert data into the temporary table in AL, and the SSRS just displays all the data and does not require additional processing.

    Jus an idea, hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Hi jdrco ,

    You can go with the SSRS reporting, please refer below link, if it help you.

    docs.microsoft.com/.../lesson-6-adding-grouping-and-totals-reporting-services

  • Dixonsamuel Profile Picture
    60 on at

    I would use SSRS to do the grouping instead.

    You can use AL to form up the data set, then use SSRS to group the figures.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans