How to Create Awesome Business Central Data Analysis – Part 2

Wow! Microsoft’s Business Application Summit just got over and I can’t believe all of the great things that were announced. check out the following links for details on the summit.

Here is a list of some of the features that are coming:

  1. Integration with Python – Connector and custom visuals like R
  2. Composite model – Composite models allow you to mix import and tabular direct query sources.
  3. Aggregations – Massive volumes of data require new ways of storing information to balance the needs of slice-and-dice interactive analysis with deep, detail-level reporting.
  4. Intellisense support for the M formula language
  5. Smart Data Prep – Data profiling and fuzzy-logic matching

Find out more about these feature and more by viewing the On Demand sessions from the Business Applications summit – https://www.microsoft.com/en-us/businessapplicationssummit[](https://www.microsoft.com/en-us/businessapplicationssummit)

October 2018 Release Overview – https://docs.microsoft.com/en-us/business-applications-release-notes/October18/[](https://docs.microsoft.com/en-us/business-applications-release-notes/October18/)

Now on to part two of my Create Awesome Business Central Data Analysis. In my last post, How to Create Awesome Business Central Data Analysis, one of the things I discussed was how to connect Power BI to Dynamics 365 Business Central and build an Inventory Performance report.

Creating our Sales Performance Visual

Here are the data tables we are going to import to analyze our Business Central sales data:

  • SalesDashboard
  • Customers
  • Customer List

After importing the SalesDashboard data we need to make the following changes.

  1. Rename several columns
  2. Remove several columns listed below in the M Code.
  3. Add a custom column to calculate Profit

Here is the M code to help you with the transformations. You will need to change the source information to match your environment.

    Source = Dynamics365BusinessCentral.Contents(null),
    #"CRONUS USA, Inc." = Source{[Name="CRONUS USA, Inc."]}[Data],
    SalesDashboard_table = #"CRONUS USA, Inc."{[Name="SalesDashboard",Signature="table"]}[Data],
    #"Renamed Columns" = Table.RenameColumns(SalesDashboard_table,{{"AuxiliaryIndex1", "Country"}, {"AuxiliaryIndex3", "Item No"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"ETag"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"SalesPersonName", "SalesPerson Name"}}),
    #"Removed Columns1" = Table.RemoveColumns(#"Renamed Columns1",{"Sales_Amount_Expected", "Cost_Amount_Expected", "Customer_Disc_Group", "Country"}),
    #"Added Custom" = Table.AddColumn(#"Removed Columns1", "Profit", each [Sales_Amount_Actual]+[Cost_Amount_Actual]),
    #"Calculated Absolute Value" = Table.TransformColumns(#"Added Custom",{{"Quantity", Number.Abs, type number}, {"Cost_Amount_Actual", Number.Abs, type number}}),
    #"Renamed Columns2" = Table.RenameColumns(#"Calculated Absolute Value",{{"AuxiliaryIndex2", "Customer No"}})
in
    #"Renamed Columns2"

Now with all three Business Central view imported, we can Save & Apply our changes.

Creating the DAX for our Sales Performance Report

On the Sales Performance report, I’ve added the ability to segment my Accounts Receivable into aging buckets. Here are the steps I used to add the changes to the report.

  1. First, I clicked on the “Enter Data” icon from the Home tab in Power BI Desktop and entered the following information and named the table “AR Buckets”.AR Buckets Table
  2. The DAX Columns & Measures needed for our visuals:

First our new two columns:

InvoiceAge =
 ( TODAY () )
    - IF (
        ISBLANK ( 'Customer List'[Posting_Date] ),
        TODAY (),
        'Customer List'[Posting_Date]
    )
ARBucket = 
CALCULATE(
    VALUES('AR Buckets'[Bucket]),
    FILTER(
        'AR Buckets',
        'Customer List'[InvoiceAge] >='AR Buckets'[Min]
        && 'Customer List'[InvoiceAge] < 'AR Buckets'[Max]
    )
)

Then our DAX measure:

Aged_AR = 
IF (
    COUNTROWS ( 'AR Buckets' ) = 1,
    CALCULATE (
        [AR_Balance],
        FILTER (
            'Date',
            MAXX ( 'Date', MAX ( 'Date'[Calendar EndOfMonth] ) - EARLIER ( 'Date'[Date] ) )
                >= MAX ( 'AR Buckets'[Min] )
                && MAXX ( 'Date', MAX ( 'Date'[Calendar EndOfMonth] ) - EARLIER ( 'Date'[Date] ) )
                    < MAX ( 'AR Buckets'[Max] )
        )
    ),
    [AR_Balance]
)

With the Columns and Measure created for the Aged Account Receivable visual, let’s work on our Gross Sales, Revenue Total, Revenue Percent, Cost Total and Cost Percent DAX Measures.

Gross Sales CY = SUM('Sales'[Sales_Amount_Actual])
Gross Sales LY = CALCULATE( 
    [Gross Sales CY] , 
        SAMEPERIODLASTYEAR( 'Date'[Date] ))
RevenueTotal =
CALCULATE ( SUM ( 'Sales'[Sales_Amount_Actual] ), ALL ( 'Sales' ) )
RevenuePct = 
    SUM('Sales'[Sales_Amount_Actual])/[RevenueTotal]
SalesCostTotal = 
    CALCULATE(SUM('Sales'[Cost_Amount_Actual]),ALL('Sales'))
SalesCostPct = 
    SUM('Sales'[Cost_Amount_Actual])/[SalesCostTotal]

With all of the DAX Columns and Measures created we can now put them all together to create the below Sales Performance report that now gives us the ability to track KPI to goals, see Sales, Profit and Cost trends over time. Here is how we create our visuals:

  • Gross Sales KPI – add the Gross Sales CY measure to the Indicator field in the Visualization pane, Calendar Year from Date dimension to Trend axis and Gross Sales LY measure to Target goals.
  • Gross Sales and Profit Gauge – Add Gross Sales to the Value field of the Visualization pane and Profit to the Minimum value field.
  • Aged Accounts Receivable clustered bar chart – Add ARBucket column from Customer List to the Axis field in the Visualization pane and Aged_AR measure to the Value field.
  • Cost vs Revenue % by Product EnhancedShatter chart – Add Item Description to the Details field in the visualization pane, RevenuePct measure to the X Axis field, SalesCostPct to the Y Axis field, Sales_Amount_Actual field to the Size field and Profit to the Color saturation field.
  • Current to Prior Year Sales by Month clustered column chart – Add Calendar Month from the Date dimension to the Axis field in the visualization pane, Gross Sales CY and Gross Sales LY measures to the Value field.
  • Gross Sales by State line and clustered column chart – Add State from the Customers dimension to the Shared Axis field in the visualization pane and Gross Sales to the Columns Value field.

Power BI Sales Performance Report

Start your Power BI learning for free and bring your company data to life!

Power BI transforms your company’s data into rich visuals for you to collect and organize so you can focus on what matters to you. Stay in the know, spot trends as they happen, and push your business further.

Looking for new ways to find and visualize data and to share your discoveries? Power BI can help. This collection of tools, online services and features from Microsoft transforms your company’s data into rich visuals for you to collect and organize, so you can spot trends, collaborate in new ways, and make sense of your data. Start your Power BI learning at some of these great sites:

Happy learning and visualizing your data!

Advertisements

How to Create Awesome Business Central Data Analysis

In my last post, 3 Thing to Know About Dynamics 365 Business Central, one of the things I discussed was how to connect Power BI to Dynamics 365 Business Central. The Power BI Content Pack has several reports. Two of those are “Item Sales Dashboard” and “Customer Sales Dashboard” (screenshots below). These are a good start but enhance our data analysis by connecting to our data and transforming it and adding some DAX measures.

Item Sales Dashboard

Customer Sales Dashboard

Creating our Visuals

First some basics, before we connect to our Dynamics 365 Business Central data. We need a Power BI model with a good date dimension table and there is no better place to start then with #sqlbi.com DAX Date template. You can get it here: https://www.sqlbi.com/tools/dax-date-template/. Alberto and Marco do a great job teaching all things DAX, so explore around while you’re on their web site.

Now let’s add Dynamics 365 Business Central as a data source in Power BI Desktop

  1. In Power BI Desktop, in the left navigation pane, choose Get Data.
  2. In the Get Data window, choose Online Services, choose Microsoft Dynamics 365 Business Central, and then choose the Connect button.Get Data connect login to Business Central
  3. Power BI displays a wizard that will guide you through the connection process. You will be prompted to sign into the service. Select Sign in and choose the account you would like to sign in as. This should be the same account you sign into Dynamics 365 Business Central with.Business Central Login
  4. Choose the Connect button to continue. The Power BI wizard shows a list of Microsoft Business Central companies and data sources. These data source represent all the web services that you have published from each company in Microsoft Dynamics 365 Business Central.Connect screen
  5. Alternatively, create a new web service URL in Dynamics 365 Business Central by using the Create Data Set action in the Web Services page, using the Set Up Reporting Assisted Setup guide, or by choosing the Edit in Excel action in any lists.
  6. Specify the data you want to add to your data model, and then choose the Load button.
  7. Repeat the previous steps to add additional Microsoft Dynamics 365 Business Central, or other data, to your Power BI data model.

Once the data is loaded it will appear in the right navigation on the page. At this point, you have successfully connected to your Microsoft Dynamics 365 Business Central data and are ready to begin building your Power BI report.

Before building your report, we recommend that you import the Microsoft Dynamics 365 Business Central theme file. The theme file will create a color palette so that you can build reports with the same color styling as the Microsoft Dynamics 365 Business Central content packs without requiring you to define custom colors for each visual. You can find the download for the json theme file here: https://community.powerbi.com/t5/Themes-Gallery/Microsoft-Dynamics-365-Business-Central/m-p/385875

Business Central available data

Here are the data tables we are going to import:

  • InventoryItems
  • InventoryTransactions
  • ItemLedgerEntries
  • ItemSalesandProfits

After importing the InventoryItems data we need to make the following changes.

  1. Rename the “No” column to “Item No”
  2. Remove several columns listed below in the M Code.
  3. Add a custom column to calculate Unit Profit

Here is the M code to help you with the transformations. You will need to change the source information to match your environment.

    Source = Dynamics365BusinessCentral.Contents(null),
    #"CRONUS USA, Inc." = Source{[Name="CRONUS USA, Inc."]}[Data],
    InventoryItems_table = #"CRONUS USA, Inc."{[Name="InventoryItems",Signature="table"]}[Data],
    #"Renamed Columns" = Table.RenameColumns(InventoryItems_table,{{"No", "Item No"}}),
    #"Trimmed Text" = Table.TransformColumns(#"Renamed Columns",{{"Description", Text.Trim, type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Trimmed Text",{"Created_From_Nonstock_Item", "Substitutes_Exist", "Stockkeeping_Unit_Exists", "Assembly_BOM", "Production_BOM_No", "Routing_No", "Shelf_No", "Cost_is_Adjusted", "Standard_Cost", "Last_Direct_Cost", "Price_Profit_Calculation", "VAT_Prod_Posting_Group", "Item_Disc_Group", "Tariff_No", "Search_Description", "Overhead_Rate", "Indirect_Cost_Percent", "Blocked", "Last_Date_Modified", "Manufacturing_Policy", "Flushing_Method", "Assembly_Policy", "Default_Deferral_Template_Code", "Global_Dimension_1_Filter", "Global_Dimension_2_Filter", "Location_Filter", "Drop_Shipment_Filter", "Variant_Filter", "Lot_No_Filter", "Serial_No_Filter", "ETag", "Item_Tracking_Code"}),
    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Unit Profit", each [Unit_Price]-[Unit_Cost]),
    #"Replaced Value" = Table.ReplaceValue(#"Added Custom","","KIT",Replacer.ReplaceValue,{"Item_Category_Code"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Replaced Value",{{"Gen_Prod_Posting_Group", "Channel Name"}, {"Item_Category_Code", "Item Category"}, {"Base_Unit_of_Measure", "Unit of Measure"}, {"Profit_Percent", "Profit Percent"}, {"Inventory", "Inventory Qty"}, {"Unit_Cost", "Unit Cost"}, {"Unit_Price", "Unit Price"}})
in
    #"Renamed Columns1"

Now let’s duplicate the Inventory Transactions data and make some changes to it.

  1. Right click on the InventoryTransactions table and select “Duplicate”
  2. Rename the duplicated table to Inventory Amounts
  3. Remove several columns. They are listed below in the M code
  4. Select the Transform tab and then the Group By icon on the menu
  5. Select the advanced option and group the data by Posting_Date and Item_No and sum the Inventory Quantity
    Group By screen
    Here is the M code to help you with the transformations. You will need to change the source information to match your environment.
    Source = Dynamics365BusinessCentral.Contents(null),
    #"CRONUS USA, Inc." = Source{[Name="CRONUS USA, Inc."]}[Data],
    InventoryTransactions_table = #"CRONUS USA, Inc."{[Name="InventoryTransactions",Signature="table"]}[Data],
    #"Renamed Columns" = Table.RenameColumns(InventoryTransactions_table,{{"Document_No", "Document No"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Expiration_Date", "ETag", "Document_Type", "Document No", "Document_Line_No", "Variant_Code", "Description", "Return_Reason_Code", "Global_Dimension_1_Code", "Global_Dimension_2_Code", "Serial_No", "Lot_No", "Cost_Amount_Non_Invtbl", "Cost_Amount_Expected_ACY", "Cost_Amount_Actual_ACY", "Cost_Amount_Non_Invtbl_ACY", "Completely_Invoiced", "Open", "Drop_Shipment", "Assemble_to_Order", "Applied_Entry_to_Adjust", "Order_Type", "Order_No", "Order_Line_No", "Prod_Order_Comp_Line_No", "Job_No", "Job_Task_No", "Dimension_Set_ID", "Item_No_Link", "Job_No_Link", "Job_Task_No_Link", "Cost_Amount_Expected", "Reserved_Quantity", "Qty_per_Unit_of_Measure", "Sales_Amount_Expected", "Entry_No", "Location_Code", "Shipped_Qty_Not_Returned", "Sales_Amount_Actual", "Cost_Amount_Actual", "Invoiced_Quantity"}),
    #"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"Remaining_Quantity", "Inventory_Quantity"}}),
    #"Grouped Rows" = Table.Group(#"Renamed Columns1", {"Posting_Date", "Item_No"}, {{"InvQty", each List.Sum([Inventory_Quantity]), type number}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Posting_Date", Order.Ascending}})
in
    #"Sorted Rows"

Creating the DAX for our Visuals

On the Inventory Performance report, I’ve added the ability to segment my quantity sold by growth rate over the previous period selected. Here are the steps I used to add the changes to the report.

  1. First, I clicked on the “Enter Data” icon from the Home tab in Power BI Desktop and entered the following information and named the table “Growth Segments”.
  2. The DAX measures needed for our visuals:

Total Qty Sold CY = SUM('Inventory Amounts'[InvQty])

CALCULATE( 
    [Total Qty Sold CY], 
    SAMEPERIODLASTYEAR( 'Date'[Date] ))

Qty Sold Growth = DIVIDE([Total Qty Sold CY],[Total Qty Sold LY],0)-1

    CALCULATE (
    [Total Qty Sold CY],
    FILTER (
        VALUES ( 'Inventory Items'[Item No] ),
        COUNTROWS (
            FILTER (
                'Growth Segments',
                [Qty Sold Growth] >= 'Growth Segments'[Min]
                    && [Qty Sold Growth]  0))
InventoryAvgAmt = SUM('Inventory Amounts'[Inventory Cost])/DISTINCTCOUNT('Inventory Amounts'[Posting_Date])
COGS_Actual = ABS(SUM('Inventory Transactions'[Cost_Amount_Actual]))

Turnover = [COGS_Actual]/[InventoryAvgAmt]

Inventory period = 365/[Turnover]

With all of the DAX Measures created we put them all together to create the below Inventory Performance report that now gives us the ability to track KPI to goals, see Sales and inventory quantity trends over time and visualize quantity sold per growth group compared to last period.

Inventory Performance Report

In my next post, I will create the Customer Sales Performance report to complete the enhance of the Business Central Sales Content pack. Until then, go sign up for a free trial of Dynamics 365 Business Central at https://trials.dynamics.com/. You just need to provide your work email address and Phone Number. Dynamics 365 Business Central is an all-in-one business management solution that helps organizations streamline business processes, improve customer interactions and enable growth by offering:

  • Business without silos. Unify business and boost efficiency with automated tasks and workflows—all from within familiar Office tools like Outlook, Word, and Excel.
  • Actionable insights. Achieve greater outcomes and gain a complete view across the business with connected data, business analytics, and guidance delivered by Microsoft’s leading intelligent technologies.
  • Solutions built to evolve. Start quickly, grow and adapt in real time with a flexible platform that makes it easy to extend beyond Business Central based on evolving business needs.

3 Things to Know About Dynamics 365 Business Central

Just got done with two days of learning about Dynamics 365 Business Central at the Microsoft Center in New York City. Before the training, my main focus was on how to use it with Power BI. This was my first training related to Business Central and the trainers, Craig, @craigcrescas, and Tom did a great job!!

Dynamics 365 Business Central is an all-in-one business management solution that’s easy to use and adapt, helping you connect your business and make smarter decisions. Built on functionality within Microsoft Dynamics NAV and adaptable to extend business applications to other Microsoft Cloud Services such as Office 365, Microsoft Flow, Power BI and PowerApps.

In this post I’m going to discuss some of my biggest take a ways – Ready To Go, Built to Develop and Office 365 and Power BI integration.

Ready To Go

If you haven’t found it yet, go to http://aka.ms/readytogo. There you we find information on:

* “Ready To Go” online learning

* “Ready To Go” coaching

* “Ready To Go” platform

“Ready To Go” online learning

The “Ready to Go” online learning catalog is an extensive library of training materials, hosted on the Dynamics Learning Portal. You can find the “Ready to Go” online learning catalog here.

This catalog contains readiness information for marketers, business decision makers, architects, and developers. The content addresses the needs of both reselling partners of Dynamics 365 Business Central as App builders who want to provide Apps on Microsoft AppSource. Currently there is over 15 hours of online learning. Here are some of the catalog categories:

Online learning catalog

“Ready To Go” coaching

The “Ready to Go” coaching is executed by Microsoft Development Centers and Master VARs, which are independently owned and operated. They bring technical services and coaching to market and have industry specific knowledge that you can contract and leverage when developing your offerings. Over time they have developed lots of best practices by supporting multiple partners, they also have strong ties with Microsoft’s R&D teams and are always up to date on the latest strategy and product innovation.

The “Ready to Go” validation workshop is offered by all Development Centers and Master VARs at fixed price and is designed to coach you in bringing your Dynamics 365 Business Central offerings to market faster and with less friction by providing individual coaching. This 8-hour workshop helps partners make the right decisions and is based upon a unified checklist and set of training materials. The workshop validates and coaches the partner’s readiness on their go-to market business model, marketing plans, architectural plans, app Development and internal readiness.

Where needed the Microsoft Development Centers and Master VARs have more offerings to support you. We recommend reaching out if you want more information.

“Ready To Go” platform

To support you in App development, testing and learning scenario’s, the “Ready to Go” platform is a place where you can find current, upcoming and daily builds of Dynamics 365 Business Central. It also holds a way to provide feedback to the Microsoft engineers working on Dynamics 365 Business Central. These builds are made available to you on the Microsoft Collaborate platform. To get access to the “Ready to Go” platform, you need to go through these steps:

  1. Register on Microsoft Collaborate using your AAD Global Admin account.
  2. Contact us, once registered on Microsoft Collaborate. Your company’s Azure Active Directory (AAD) global administrator should contact us to complete the on-boarding. We need to manually assign you to the right programs and engagements. Expect a response from us within 1-2 business days.
  3. The Ready to Go team will notify you and confirm your registration.

Built for Development

Dynamics 365 is a flexible business platform that can be scaled to suit and meet your business needs in terms of size and complexity. There are three ways that the system can be customized by either using – Personalize, Designer or Visual Studio Code for al language development. Personalize can be done by the Business Central end user by simply navigating to the gear icon in the top right corner of the window/screen you are on and selecting “Personalize”.

Personalize Screenshot

For me, I’m on the Sales Order window. I now select the Sales Order line detail section and select the “Field” option in the top gray bar. From there you will get the “Add Field to Page” section on the right of the below screenshot. Use the search function and type in “Bin”. Now drag the Bin Code field over the Lines section of the Sales Order. Select “Done” to complete your personalization.

Screen Personalization

Designer is a little more work in the customization process but is applied globally instead of at a personal level. First you will need to create a Sandbox. A sandbox environment (Preview) is a non-production instance of Business Central. Isolated from production, a sandbox environment is the place to safely explore, learn, demo, develop, and test the service without the risk of affecting the data and settings of your production environment. Here is the link to how to create one. Once you’re done, you should see “Sandbox” in the black tool bar on the top right of the screen. Selecting the gear icon once again will bring up the additional “Designer” option. Both the Designer and custom al language option should be handled by a developer or more technical user. You can read more about these option in the “Ready To Go” online learning Technical catalog categories discuss above.

Power BI Integration

Getting insights into your Business Central data is easy with Power BI and the Business Central content packs. Power BI retrieves your data and then builds an out-of-the-box dashboard and reports based on that data.

You must have a valid account with Dynamics 365 and with Power BI. Also, you must download Power BI Desktop if you wish to create your own Power BI reports. Power BI content packs require permissions to the tables where data is retrieved from.

How to Connect

  1. Select Get Data at the bottom of the left navigation pane. You may also get starting from within Dynamics 365 Business Edition. From the role center, navigate to Report Selection in the Power BI Role Center part. Select either Service or My Organization from the ribbon. When either of these actions are selected, you will be taken to either the Organization gallery in Power BI or to the services library in Power BI, which will also be filtered to only display content packs related to Dynamics 365 Business Central.Get Data
  2. You may also get starting from within Dynamics 365 Business Edition. From the role center, navigate to Report Selection in the Power BI Role Center part. Select either Service or My Organization from the ribbon. When either of these actions are selected, you will be taken to either the Organization gallery in Power BI or to the services library in Power BI, which will also be filtered to only display content packs related to Dynamics 365 Business Central.
  3. In the Services box, select Get. This will open a window with the AppSource and Apps for Power BI apps.Get Services
  4. Select Apps from the Apps for Power BI apps tab, search for “Business Central” content pack that you want to use, and then select Get it now for the App you want to load. I choose “Microsoft Dynamics 365 Business Central – Sales. Dynamics 365 Business Central Apps
  5. When prompted, enter the name of your company in Dynamics 365 Business Central. This is not the display name. The company name can be found on the ‘Companies’ page within your Dynamics 365 Business Central instance. Company Name
  6. You can find the Company Name in Business Central by searching with the magnifying glass and typing in “companies”. Your screen should look like the below screenshot. Business Central Companies screen
  7. Once connected, a dashboard, report and dataset will automatically be loaded into your Power BI workspace. Power BI Business Central - Sales Report
  8. When completed, navigate back to Business Central’s home page and down to the bottom right corner. Click on the Ellipsis, “…”, in the top right of the Power BI section to Select Report and enable the reports you just deployed. Select ReportEnable Report
  9. You should now see your report and you can use the Previous Report and Next Report menu options to view all reports available.

Stay tuned for more on Business Central and Power BI