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

power bi - bc report sales and invoices- how do you relate them- no common key on REST data

(0) ShareShare
ReportReport
Posted on by 80

Business Central Online-  Doing Consolidated reporting.- Sales orders and Invoices.

There appears to be relationships and tables not exposed to REST API- I need to relate Invoices to Sales Orders. Can anyone give guidance on what data to extract? I have Sales orders and related sales order line items . I have Invoices. But cannot related them due to no common field. Sales order and line items get removed when posted to an invoice.2388.BC_2D00_-REST-API_2D00_-power-bi-how-to-relate-invoces-to-sales-orders.jpg

  • field service sample data - crm d365 Profile Picture
    80 on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Steven- thank you for your reply. I voted up and commented on the link you recommended.  Tim

  • field service sample data - crm d365 Profile Picture
    80 on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Rick-- thank your for taking the time to address my issues. -- I have restated this issue and provided additional screen shots- apologize for the large font.

    POWER BI get data connector to DYNAMICS BUSINESS CENTRAL - entities don't match rest api docs and I cannot relate invoices to sales order and sales order line items

    I am trying to create power bi financial reports which need to relate invoices to sales order at the line item level as the workflow moves from order to ship to invoice. When the invoice is posted the connector entity does not include the sales order in the invoice or invoice line items (the rest api does). The sales order data is deleted and is not available after invoice is posted. 

    Blocked until I can unravel this-- help appreciated.

    BC_2D00_-API_2D00_-SalesInvoice.jpg

    BC_2D00_-connector-_2300_2_2D00_-power-bi-how-to-relate-invoces-to-sales-orders.jpg

  • Suggested answer
    Steven Renders Profile Picture
    5,500 Moderator on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Hi Tim,

    I recommend not using the current API's for Power BI reports.

    Because they, usually, are: slow, contain a lot of fields you don't need and don't contain the fields you need. Imho it's much better to use the development environment to create queries for the tables you need in Power BI. Create a star or snowflake schema and filter and aggregate the queries using group-by's.

    Also, normally in BC, when a sales order is invoiced (and completely posted) it's deleted, so you can't import it anymore in PBI... If you want to be able to import posted sales orders, you need to archive them in BC and then import from the archive, or manually create an archive. (This might require a code-modification in BC, depending on your localisation.)

    Actually, you should have a good understanding on the BC data and process model, before you start to create reports, but it's also very true that there's very little information available in the docs.

    I suggest voting for this idea: experience.dynamics.com/.../ ;-)

    What exactly do you need to relate? Do you need the Order No on the Invoice, or do you need more? The Order No should be available in the Sales Invoice Header/Line table(s).

    Also know that when you use the SIH/L table(s) you will not have the credit memos, returns,... That is why it might be better to use the Customer Ledger Entry table (or other ledger entry tables). It all depends on the requirements for the reports.

  • field service sample data - crm d365 Profile Picture
    80 on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Thank you for your reply-- the rest api call appears to have the ability to relate them... the power bi get data -- list of data sources is different and does not match what is available thru a rest api call in the docs. The names are different and the fields are different. would appreciate a guide to pull this together. I do not find the ability to relate them and have profiled the data sources and processed step-by-step thru a specific workflow of a sales order to ship to invoice. I am planning to use power bi for a suite of financial reports but maybe this is not possible to use power bi in this case. Is it possibles to expose the rest api fields to power bi GET Data to help resolve the issues?

  • Mohamad Vajid Profile Picture
    on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Hello,

    I am not sure I understood the request entirely, but did you have a look here for all the standard API resource types that are available OOB?

    docs.microsoft.com/.../

    You can see on the left side all the standard API resource types, their methods, properties, and relationships.

    SalesInvoice for example:

    docs.microsoft.com/.../dynamics_salesinvoice

    Hope this helps.

  • field service sample data - crm d365 Profile Picture
    80 on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Has anyone any further info on data definitions and structure as well as work flow? I only have found on old 2018 Nav one and it would help to have some further definitions to understand the fields and workflow. The data in salesDocument and salesDocumentLines need relationship to nativeInvoicingSalesInvoiceOverview and nativeInvoicingSalesInvoices. The sample Invoice print shows that it is being related..Are there other relevant REST calls or data sets ?

  • André Arnaud de Calavon Profile Picture
    294,261 Super User 2025 Season 1 on at
    RE: power bi - bc report sales and invoices- how do you relate them- no common key on REST data

    Moved to the Dynamics 365 Business Central forum.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans