Project

Automating Inventory Management with Power BI and Process Automation

A comprehensive project plan to automate inventory reporting using Power BI, process automation, and email integration.

Empty image or helper icon

Automating Inventory Management with Power BI and Process Automation

Description

This project aims to streamline the inventory reporting process by creating an automated system using Power BI. The system will leverage inbox CSV data, historical purchase data, and process automation to generate actionable reports. It will identify problematic vendors, manage inventory levels, and maintain service levels, all while ensuring minimal manual intervention. The project will also include functionality for projecting purchases, managing promotion notes, and communicating with leadership teams effectively.

The original prompt:

I'm looking to automate my inventory reporting I get updated daily inventory data landed in my inbox inside of outlook every morning in a CSV file what we are looking to do is to identify the problem vendors the ones that are slightly above we have too much inventory or whatever and we're looking to lower our overtop all inventory levels the other thing that we need to keep in close consideration is service levels so basically twice a week we send a report to our leadership team of our inventory levels we also need to project our purchases and what will receive for the rest of the month so right now what I'm trying to do is use power BI to automate all this but where some of the data needs to come out of daily Excel files because I don't have access to the back end SQL database I only have what they've already parked in power BI for me which does contain you know our historical purchases and data but it doesn't contain real time inventory and it doesn't contain expected purchase order dates it could be possible that we calculate lead times inside of there but they don't have our receipt data either so what I'm really looking to figure out is what are the kind of custom tables that I need to build and how can I automate the inventory and the other possible csp's from my email which are just exports from our ERP into a report that I don't have to update and dig through all the time and also we can add notes for other vendors that we are looking to say we're running a clearance promotion on this vendor or I'm working with the sales team to unload this stock

For an output I'm really looking for the project plan recommended path forward we have Microsoft Power BI have access to a lot of fabric power apps I don't have a premium license I don't think but I can get in there and most other Microsoft 365 products and power apps

Daily Email Integration and Data Import

Introduction

This section covers the practical implementation of automating daily email integration and data import into Power BI. This includes setting up the email system to receive data, extracting attachments, and loading data into Power BI for further analysis.

Setup Instructions

Email Integration

  1. Create an Email Account:

    • Use a corporate or dedicated email account for receiving inventory reports.
  2. Configure Email Settings:

    • Ensure the email account supports IMAP/SMTP protocols.

Process Automation

  1. Automate Email Retrieval and Attachment Extraction:
    • Use Power Automate to create a flow that retrieves email attachments.

Power Automate Flow Steps

  1. Trigger - When a New Email Arrives:

    • Set up the trigger in Power Automate to monitor the inbox for new emails.
  2. Condition - Check for Attachments:

    • Add a condition to check if the email contains attachments.
  3. Action - Save Attachments:

    • Define action to save attachments to a designated OneDrive or SharePoint folder.
Trigger: "When a new email arrives"
Condition: "Email contains attachments == true"
Action: "Save attachment to OneDrive / SharePoint"
    Destination: 

Data Import

  1. Load Data into Power BI:
    • Configure Power BI to import data from the saved attachments. This is a recurring process to ensure daily updates.

Steps for Power BI:

  1. Get Data:

    • Open Power BI Desktop and go to Home > Get Data.
  2. Select Data Source:

    • Choose OneDrive or SharePoint Folder as your data source.
  3. Connect:

    • Authenticate and navigate to the folder where attachments are saved.
  4. Load Data:

    • Select the relevant files and load them into Power BI.
  5. Transform Data:

    • Use Power Query to clean and transform data as required.
  6. Create Visualizations:

    • Build your inventory report visualizations based on the imported data.
Power BI - Load Data:

1. Home > Get Data > SharePoint Folder / OneDrive
2. Connect and navigate to the folder
3. Select files and load them
4. Use Power Query for data transformation
5. Create inventory visualizations

Conclusion

By following these steps, you will automate the process of receiving daily inventory reports via email, extracting attachments, and importing data into Power BI for analysis. This ensures seamless and efficient data integration, saving time and reducing manual efforts.

Building Custom Tables and Data Models for Automating Inventory Reporting

Step 1: Define the Data Model in Power BI

To build custom tables and data models in Power BI, you'll need to define the schema of your data model. This involves specifying tables, relationships, and measures.

1.1 Define Tables

Define the tables with required columns. Examples of tables may include Inventory, Transactions, Suppliers, etc.

Example

Table: Inventory
Columns:
- ItemID (Primary Key)
- ItemName
- Category
- StockQuantity
- ReorderLevel

Table: Transactions
Columns:
- TransactionID (Primary Key)
- ItemID (Foreign Key)
- Quantity
- TransactionDate
- TransactionType (IN/OUT)

Table: Suppliers
Columns:
- SupplierID (Primary Key)
- SupplierName
- ContactNumber

Step 2: Create Relationships Between Tables

Establish relationships between tables in Power BI to create a cohesive data model.

Example

  • Inventory.ItemID (One) <---> Transactions.ItemID (Many)
  • Suppliers.SupplierID (One) <---> Inventory.SupplierID (Many)

Step 3: Load Data

Use the Power BI interface to import data into Power BI from various data sources like SQL Server, Excel, etc.

Step 4: Define Calculated Columns and Measures

Create calculated columns and measures to enhance the data model.

Example

Calculated Column: Total Stock Value

TotalStockValue = [StockQuantity] * RELATED(Transactions.Price)

Measure: Current Stock

CurrentStock = SUM(Inventory[StockQuantity])

Measure: Items to Reorder

ItemsToReorder = COUNTROWS(
  FILTER(Inventory, Inventory[StockQuantity] < Inventory[ReorderLevel])
)

Step 5: Automate Data Refresh

Set up a scheduled refresh in Power BI to ensure that your data is automatically updated.

Example

  1. Go to the Datasets section.
  2. Select Schedule Refresh.
  3. Configure the refresh frequency and time.

Step 6: Email Integration for Reporting

Integrate with a process automation tool like Microsoft Power Automate to send daily or weekly reports via email.

Example

  1. Create a new flow in Power Automate.
  2. Use the Power BI connector to automate sending reports.
  3. Set the trigger for the flow (Scheduled, e.g., daily at 8 am).
  4. Add actions to Get Data from Power BI and Send an Email with the data.

Power Automate Pseudocode:

Trigger: Recurrence (Daily at 8 am)
Actions:
- Power BI: Export Data (Export your inventory report dataset)
- Email: Send an Email
  - To: [Recipients]
  - Subject: "Daily Inventory Report"
  - Body: Attach the exported data

Conclusion

Implement the above steps to build custom tables and data models in Power BI for your inventory reporting automation project, integrating with process automation tools for seamless email reporting.

Automating Inventory Reporting with Power BI

Overview

This part will focus on automating the creation and distribution of inventory reports in Power BI. We'll leverage Power BI's capabilities to generate reports and enable process automation to distribute these reports via email.

Creating & Automating the Report

  1. Open Power BI Desktop:

    • Ensure you have your data models and tables established from previous steps.
  2. Create the Inventory Report:

    • Use the Report View in Power BI Desktop.
    • Drag and drop necessary fields and visualizations (e.g., tables, charts) to create a comprehensive inventory report. Format and design the report as required.
    • Save the report once completed.
  3. Publish to Power BI Service:

    • In Power BI Desktop, click on "File" -> "Publish" -> "Publish to Power BI".
    • Sign in with your organizational credentials and select the appropriate workspace to publish the report.
  4. Power BI Service - Create and Configure a Dashboard:

    • Navigate to Power BI Service and locate the published report.
    • Create a new Dashboard and pin necessary report components (visualizations) to this dashboard.
  5. Automating Report Refresh:

    • Go to Datasets in Power BI Service.
    • Select your published dataset associated with the inventory report.
    • Configure the "Scheduled refresh" settings:
      • Set the refresh frequency (daily, weekly, etc.).
      • Enter your data source credentials if prompted.

Automating Email Distribution

  1. Set Up Power Automate (formerly Microsoft Flow):

    • Log into Power Automate.
    • Create a new flow using a template or start from blank.
  2. Trigger Flow Based on Dataset Refresh:

    • Choose a trigger such as "When a data-driven alert is triggered" (available in Power BI connectors).
      • Select the relevant workspace, dashboard, and the specific condition that should trigger the flow. For example, set an alert if inventory levels fall below a certain threshold.
  3. Action: Export Report to PDF:

    • Add an action to "Export a Power BI report to a file".
    • Configure this action to export the report as a PDF file.
    • Choose the workspace, report, and page as necessary.
  4. Action: Send an Email with the Report:

    • Add an action to "Send an email" (using Outlook or similar mail service).
    • Configure the email settings:
      • To: [List of recipients]
      • Subject: "Automated Inventory Report"
      • Body: "Please find attached the latest automated inventory report."
      • Attach the exported PDF file from the previous action.
  5. Save and Test the Flow:

    • Save the Power Automate flow.
    • Test the flow to ensure everything is working correctly by manually triggering the dataset refresh or alert condition.

By following these steps, your inventory reports will be automatically generated and distributed via email, ensuring timely communication and data-driven decision-making.

Conclusion

Utilizing Power BI and Power Automate, this implementation links data refresh in Power BI with automated email notifications, streamlining inventory reporting. This process ensures that relevant stakeholders receive up-to-date reports without the need for manual intervention.

Service Level Monitoring and Vendor Management Implementation

Service Level Monitoring

To monitor the service levels of vendors effectively and handle the data through Power BI, the following steps can be implemented:

Data Sources and Integration

  1. Database/Excel Sheet of Vendor Performance Metrics: Collect the data inputs such as service uptime, delivery performance, issue resolution times, and other relevant service performance metrics. Ensure this data is regularly updated and accessible.

Power BI Implementation

  1. Loading Data:

    • Load the vendor performance metrics dataset into Power BI. This can be achieved via the 'Get Data' option in Power BI, capable of connecting to various data sources (Excel, SQL Server, etc.).
  2. Data Transformation:

    • Use Power Query to clean, reshape, and transform the data to ensure it is in a suitable format for analysis. Transformations might include renaming columns, handling missing values, and creating calculated columns as needed.
    DataSource = LoadData("VendorPerformanceMetrics")
    CleanedData = TransformData(DataSource, [
        RenameColumns, 
        HandleMissingValues, 
        CreateCalculatedColumns
    ])
  3. Creating Measures:

    • Define key performance indicators (KPIs) as DAX (Data Analysis Expressions) measures.
    ServiceUptime = DIVIDE(SUM(CleanedData[UptimeHours]), SUM(CleanedData[TotalHours]))
    DeliveryPerformance = DIVIDE(SUM(CleanedData[OnTimeDeliveries]), SUM(CleanedData[TotalDeliveries]))
  4. Visualizing Data:

    • Create Power BI dashboards and reports to visualize these KPIs. Use bar charts, line graphs, and KPI cards to display service levels over time.
    Dashboard.AddChart(ChartType.Line, CleanedData, Measure.ServiceUptime, TimePeriod.Month)
    Dashboard.AddChart(ChartType.Bar, CleanedData, Measure.DeliveryPerformance, Vendors)

Vendor Management

To manage vendor-related tasks, the following process automation steps can be set up:

Process Automation

  1. Automating Alerts and Notifications:

    • Set up automated alerts using Power Automate when KPIs fall below the defined thresholds. For example, if service uptime falls below 99%, send an email notification to the vendor and relevant stakeholders.
    Flow.Trigger = WhenKPIDropsBelowThreshold(KPI.ServiceUptime, 0.99)
    Flow.Action = SendEmail("vendor@example.com", "Service Uptime Alert", "Your service uptime has fallen below 99%. Please take corrective actions.")
  2. Email Integration:

    • Use Power Automate to schedule regular performance summary emails to vendors, providing them with insights into their monthly performance and areas of improvement.
    Flow.Trigger = ScheduleTime("Monthly", "FirstDayOfMonth")
    Flow.Action = SendEmail(
        "vendor@example.com", 
        "Monthly Performance Summary", 
        GeneratePerformanceSummaryEmailBody(CleanedData)
    )
    function GeneratePerformanceSummaryEmailBody(data):
        return "Your monthly performance metrics are as follows: \n" + 
               "Service Uptime: " + Format(data.ServiceUptime, "Percent") + "\n" + 
               "Delivery Performance: " + Format(data.DeliveryPerformance, "Percent") + "\n" + 
               "Please review and take necessary actions."

Vendor Dashboard (Power BI)

  • Create a dedicated vendor management dashboard that includes:

    • Performance trend analysis over time.
    • Comparative analysis between different vendors.
    • Detailed breakdowns of specific issues and areas for improvement.
    VendorDashboard.AddChart(ChartType.Line, CleanedData, Measure.ServiceUptime, TimePeriod.Month, ["VendorA", "VendorB"])
    VendorDashboard.AddChart(ChartType.Bar, CleanedData, Measure.DeliveryPerformance, ["VendorA", "VendorB"])
    VendorDashboard.AddTable(CleanedData, Columns=[VendorName, IssueResolutionTimes, LateDeliveries])

By implementing the above steps, you can monitor service levels and manage vendor performance effectively using Power BI and process automation. This will ensure proactive decision-making and enhance vendor relationships.

Generating Projections and Communicating Results

Introduction

This section focuses on generating projections using Power BI and communicating the results through automated reporting and email integration.

Steps for Implementation:

1. Creating Projections in Power BI

a. Calculate Forecasts

  • Use DAX (Data Analysis Expressions) to create custom measures for projections. Here’s an example to calculate projected sales:
ProjectedSales = 
CALCULATE(
    SUM(Sales[ActualSales]),
    DATESINPERIOD(
        Sales[Date],
        MAX(Sales[Date]),
        30,
        DAY
    )
) * 1.1  -- Adjust the multiplier based on historical data or trend analysis

b. Apply Time Series Analysis

  • Implement a moving average for smoother projections:
MovingAverage3Months = 
CALCULATE(
    AVERAGEX(
        DATESINPERIOD(
            Sales[Date],
            MAX(Sales[Date]),
            -3,
            MONTH
        ),
        [ProjectedSales]
    )
)

2. Create Visuals in Power BI

  • Utilize Power BI's visualization capabilities to create charts and graphs showing projections:

    • Line Charts: Ideal for trend analysis.
    • Bar Charts: Useful for comparing projected and actual sales.
    • Scatter Plots: Helps in identifying anomalies and correlations in projections.

In Power BI Desktop:

  1. Go to the 'Visualizations' pane.
  2. Select the desired visual (e.g., Line Chart).
  3. Drag and drop the fields (e.g., Date to Axis, ProjectedSales to Values).
  4. Customize the chart using the 'Format' pane.

3. Automating the Report

a. Create/Update a Power BI Report

  • Create a report page specifically for projections and ensure it updates automatically with the latest data.

b. Publish to Power BI Service

  1. Save your Power BI report (.pbix file) in Power BI Desktop.
  2. Click on 'File' -> 'Publish' -> 'Publish to Power BI'.
  3. Select your workspace and publish.

4. Communicate Results via Email

a. Set Up a Power Automate Flow

  • Use Power Automate to send emails with the latest projections.
  1. Go to Power Automate.
  2. Create a new Flow: 'Scheduled Flow'.
  3. Define trigger (e.g., daily at 8 AM).
  4. Add a new action: 'Get rows' to fetch the latest data from Excel/SQL.
  5. Add another action: 'Send an email' using Office 365 Outlook connector.
  6. Customize the email body to include key data points/numbers.
  7. Attach a snapshot of the Power BI report (if needed): a. Export the visual as a static image using Power BI REST API. b. Attach the image in the email.

Example JSON Body for Email (within Power Automate)

{ "to": "your.email@example.com", "subject": "Daily Inventory Projections Report", "body": "

Daily Report

Find attached the latest projections.

", "attachments": [ { "contentBytes": "{Base64EncodedImage}", "name": "Projections.png", "contentType": "image/png" } ] }

Conclusion

You have now set up Power BI to generate projections and automated the communication of these results through emails. This ensures stakeholders receive timely and accurate forecasts.Tabs(labels)