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

Community site session details

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

Creating a financial report in Power BI from Business Central data

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

1- Anyone has any tips on which tables shall i use to build a financial report that display revenue & quantity by customers clean of any cancellations, correction ect in the invoice (I am currently using posted sales invoice header & posted sales invoice lines table join with customer and item table)?

2- What are the very common/best practices information (with their relate tables) to have in a financial report coming from business central sources ?

I have the same question (0)
  • Verified answer
    Steven Renders Profile Picture
    5,672 Moderator on at
    RE: Creating a financial report in Power BI from Business Central data

    When you base a report upon document (header/line) tables like the Sales Invoice Header/Line, know that, depending on the setup, sometimes posted documents can be deleted, after they are printed. So you might miss some information. Also, if you want to take into account: credit memos, shipments, returns,... you will also need to include other document tables.

    So it might be more interesting to start from Ledger Entry tables, like for example:

    Customer Ledger Entry, Value Entry,...

    I would create new and separate query objects for every fact and lookup table in your PBI star/snowflake data model. Then don't forget to aggregate the ledger entries, to reduce bandwidth and improve performance...

  • KC-25070654-0 Profile Picture
    on at
    RE: Creating a financial report in Power BI from Business Central data

    Hi Steven,

    Thanks for your answer :)

    If i understood you correctly you would:

    1-Query the ledger entries tables as fact tables such as:

    - customer ledger entry

    - value entry

    - item ledger entry

    - vendor ledger entry

    2- then join them to dimension tables such as:

    - item

    - customer

    - vendor

    - ect

    3- and then filter in the visualization what you need such as:

    - Revenue from Invoice per month: Month field, amount credit memo, amount invoices

    Is it correct?

    4- What would be the main reason why we should not query the individual base tables such as:

    - Posted sales invoice

    - Credit memo

    - Sales orders

    - Purchase orders

  • Suggested answer
    Steven Renders Profile Picture
    5,672 Moderator on at
    RE: Creating a financial report in Power BI from Business Central data

    Correct, but keep in mind that I recommend aggregating the ledgers by implementing a group by, so you don't fetch every individual ledger entry. Also, I recommend using 1 ledger entry table per report, please don't add multiple ledgers in the same report...

    As an alternative you can of-course also query the document tables like posted invoice, credit memo, sales orders and purchase orders, but then you need to join them in PBI to make sense. Also, sometimes posted documents might be deleted, once printed, so you might miss certain transactions.

    Creating calculations like Revenue from Invoice per month: Month field, amount credit memo, amount invoices, I would recommend doing by creating measures in PBI. Measures are created using DAX and are calculated in memory, so they should be very fast.

  • KC-25070654-0 Profile Picture
    on at
    RE: Creating a financial report in Power BI from Business Central data

    Thanks for the answers and sorry for still having some questions.

    1- For the group by statements, would you have a practical example based on a sales invoice scenario? Also where would you implement the Group by statement?

    2- let me know if i understood correctly:

    - in the dataset you would "store" all the ledger entries and dimension tables and use a start/snowflake schema between each ledger entry and their respective dimension tables

    - in the dataset you would not recommend creating relationship between ledger entries

    - in the specific reports you would use fields from only one ledger entry table with a combination of fields from different dimension tables

  • Suggested answer
    Steven Renders Profile Picture
    5,672 Moderator on at
    RE: Creating a financial report in Power BI from Business Central data

    As a grouping example, let's look at this one:

    query 80100 _qryGLEntries

    {

       QueryType = Normal;

       DataAccessIntent = ReadOnly;

       Caption = '_GL_GLEntries_PBI';

       elements

       {

           dataitem(GLEntry; "G/L Entry")

           {

               column(GLAccountNo; "G/L Account No.")

               {

               }

               column(GLAccountName; "G/L Account Name")

               {

               }

               column(PostingDate; "Posting Date")

               {

               }

               column(DimensionSetID; "Dimension Set ID")

               {

               }

               column(Amount; Amount)

               {

                   Method=  Sum;

               }

               column(Quantity; Quantity)

               {

                   Method=  Sum;

               }

           }

       }

       trigger OnBeforeOpen()

       begin

       end;

    }

    You see, I'm calculating the Sum(Amount) and Sum(Quantity) by GLAccountNo, Name, Date,Dimension.

    Then you can add queries like:

    query 80101 _qryGLAccount

    {

       QueryType = Normal;

       DataAccessIntent = ReadOnly;

       Caption = '_GL_GLAccount_PBI';

       elements

       {

           dataitem(GLAccount; "G/L Account")

           {

               column(GLAccountNo; "No.")

               {

               }

               column(GLAccountName; Name)

               {

               }

               column(AccountCategory; "Account Category")

               {

               }

               column(AccountSubcategory; "Account Subcategory Descript.")

               {

               }

               column(AccountType; "Account Type")

               {

               }

               column(GenPostingType; "Gen. Posting Type")

               {

               }

           }

       }

       trigger OnBeforeOpen()

       begin

       end;

    }

    and

    query 80102 _qryDimensionSetEntry

    {

       QueryType = Normal;

       DataAccessIntent = ReadOnly;

       Caption = '_GL_DimensionSetEntry_PBI';

       elements

       {

           dataitem(DimensionSetEntry; "Dimension Set Entry")

           {

               column(DimensionSetID; "Dimension Set ID")

               {

               }

               column(DimensionCode; "Dimension Code")

               {

               }

               column(DimensionName; "Dimension Name")

               {

               }

               column(DimensionValueCode; "Dimension Value Code")

               {

               }

               column(DimensionValueName; "Dimension Value Name")

               {

               }

               column(DimensionValueID; "Dimension Value ID")

               {

               }

           }

       }

       trigger OnBeforeOpen()

       begin

       end;

    }

    Then you publish each query individually as a web service and you import them individually in PBI Desktop. There you can create the relationships.

    I don't recommend importing more then 1 ledger table in a PBI report. For example if you need to report on Sales and on Purchase, then I would create 2 separate PBI reports, one that uses Customer Ledgers as the fact table and another report that uses the Vendor Ledger entries. Or, if possible, one report in total that uses the Value Entries as the fact table.

    I hope this explains it a bit more?

  • Steven Renders Profile Picture
    5,672 Moderator on at
    RE: Creating a financial report in Power BI from Business Central data

    Actually, if you want to learn more, I'm delivering an online training about this on June 15- 16:

    plataan.tv/.../webinar-power-bi-for-microsoft-dynamics-365-business-central

    Which I can highly recommend ;-)

  • KC-25070654-0 Profile Picture
    on at
    RE: Creating a financial report in Power BI from Business Central data

    Thanks a lot Steven,

    1- When you say reports, do mean actual report or dataset?

    2- If you want to have the real amount of revenue per customer (including invoices, refund & credit memo) then you would:

    - create a query from the customer ledger entries where you group by the amount by customer no & posting date

    - join this query to their respective dimension table

    3- The issue with this logic is that it become complicated when in the same report you want to be able to drill down per customer, item, document number ect, or is there a best practices for this as well?

  • Steven Renders Profile Picture
    5,672 Moderator on at
    RE: Creating a financial report in Power BI from Business Central data

    With report I mean a powerbi.pbix file, so the data model. (star/snowflake) One PBI file can contain several pages, which can be different views (reports) on the same data model.

    Once you have the fact table linked to lookup tables (dimensions, item, customer, ...) you can use any of the fields (customer, item, dimension, document no, date) to slice and dice the data. (The doc no is usually also in the ledger table). That's actually very easy to do.

  • KC-25070654-0 Profile Picture
    on at
    RE: Creating a financial report in Power BI from Business Central data

    Thanks Steven for the info :)

    At the moment I have everything in one .pbix file and i would try to keep it that way so it is easier to refresh at once.

    Therefore, following your advice I ll try to only use one ledger entry table as fact table and then link it up to the dimension tables.

  • Suggested answer
    Steven Renders Profile Picture
    5,672 Moderator on at
    RE: Creating a financial report in Power BI from Business Central data

    Ok :-)

    As a tip I also recommend to have a look at the incremental refresh possibilities:

    thinkaboutit.be/.../

    This can also save time and bandwith when refresing your report(s).

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,401

#2
Sumit Singh Profile Picture

Sumit Singh 2,692

#3
YUN ZHU Profile Picture

YUN ZHU 1,935 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans