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

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,165 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
    99,090 Super User 2026 Season 1 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,794 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

  • CU17121206-0 Profile Picture
    12 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

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,949 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,064 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 559 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans