top of page
Writer's pictureSolution Systems

How to Create a Simple Sales By Customer By Item Report with Business Central



Reports are an invaluable tool for businesses. They provide decision makers with data needed to make correct decisions about the organization. Microsoft understands the need for reports and real-time data and that's why Microsoft Dynamics 365 Business Central's reporting functionality is head and shoulders above their competition. In fact, it's so advanced we're going to show you how anyone can easily build a Sales by Customer by Item report. Let's get started!


This report is simplified and is going to include the fields Sell to Customer Name, Posting Date, Document Number, Item, Item Description, Quantity, Sales Amount, Cost Amount, Gross Profit, and Gross Margin. If we were to do a more in-depth report we'd also include Posted Sales Return Receipts and Posted Sales Credit Memo. The main driver of this report is the Item Ledger Entries Report


Step 1: In Business Central navigate to the Web Services Page.

Business Central Web Services Page

Step 2: Select New and create a new page.

Business Central web services page.

Step 3: Search for the Object ID needed. For this report we need Item Ledger Entries.

Business Central web services objects

Step 4: Enter a Service Name.

Business Central web services service name

Step 5: Select Publish and a URL will populate.

Business Central OData URL

Step 6: Copy the URL.

Business Central OData URL

Step 7: In Excel, select Get Data, select Other Sources, and then select OData Feed.

Microsoft Excel OData Feed

Step 8: Paste the copied URL and select OK.

Microsoft Excel OData Feed

Tip: If you receive an error message that informs of you not being able to connect do the following and retry Step 7 and Step 8:

  1. Select Cancel.

  2. Select Get Data, select Data Source Settings, select Clear Permissions, and select Delete.

  3. Select Get Data, select Query Options, select Clear Cache, and select OK.

  4. Re-sign in with your credentials.

Unable to connect OData feed in Excel

Step 9: We can now see the data. We want to run this report just for July so we're going to click Transform Data to add the correct filters. For this example we'll be adding the date filter between 07/01/2022 and 07/31/2022 as well as a filter for Entry Type to show only Sales for the month.

Microsoft Excel filtering

Microsoft Excel filtering

Step 10: Once we have chosen the proper filters we need to select Close & Load. This will refresh the Query with our live data.

Microsoft Excel filtering

Tip: We recommend renaming your Query because we're going to be working with more than one. You can do this by right clicking on the Query name located on the side bar within Excel and selecting rename. We're going to call ours Item Ledger Entries.

Tip: We recommend renaming your Excel tab. We've named ours Report and Item Ledger Entries.


Renaming Query in Microsoft Excel

Step 11: It's time to link the report to our Query data.


From the Item Ledger Entries Tab copy the first posting date box shown and paste it under the posting date in the Reporting tab. Do the same for Document Number, Item Number, Quantity, Sales Amount Actual, Cost Amount Actual.

Microsoft Excel Query

Enter a Gross Profit calculation: Sales Amount + Cost Amount

Microsoft Excel Query

Enter a Gross Margin calculation: Gross Profit / Sales Amount

Microsoft Excel Query

Now we need to link the Item Description. We know Item Description exists on the Item Card and that means we'll need to create another Web Services Page for this by following steps 1-8 from above.

  1. On the Web Services Card in Business Central, select New, select page, select Object ID, search for Items and select Items (ID 31), enter a Service Name, select Publish, and then Copy the URL.

  2. In your Excel report select Get Data, select From Other Sources, and select OData Feed. Paste the copied URL and select OK.

  3. We don't want to apply any filters on this query so we simply select Load.

  4. We'll rename the Query and the Excel tab.

  5. In your report under Item Description we need to enter a VLOOKUP.

    1. =vlookup(D3,Items!A:B,2,false)

    2. The field is now populated

Microsoft Excel Vlookup

Next we need to link the Sell to Customer Name and this will require us to create another Web Services Page.

  1. On the Web Services Card, select new, select Page, select Object ID, search for Posted Sales Shipments (ID 130), Enter a Service Name, select Publish, and then copy the URL.

  2. In your Excel report select Get Data, select From Other Sources, and select OData Feed. Paste the URL. Select OK.

  3. Now we need to apply some filters. Let's select Transform Data and filter by posting date 07/01/2022 and 07/31/2022, select Close and then select Reload.

  4. We'll rename the Query and Excel tab.

  5. In our Report under Sell to Customer Name we need to do a VLOOKUP.

    1. =vlookup(C3,PostedSalesShipments!A:B,2,false)

    2. The field is now populated.

Microsoft Excel VLookup

Step 12: Select and drag down to populate fields.

Microsoft Excel Drag and Drop

We have now created a Sales by Item by Customer report with Business Central. In the future to refresh this report and pull in updated real-time data we select the Data tab on the top ribbon in Excel and simply select Refresh All.


Do you have more Business Central reporting questions? Fill out the form below and one of our team members will be in touch with you shortly.






Follow Us!

Recent Articles

bottom of page