This project analyzes M-Pesa transaction data from July 2023 to July 2024. The dataset was generated by Safaricom (accessible by dialing *334#) and provides a detailed breakdown of financial transactions, including:
- Receipt Number
- Completion Time
- Transaction Details
- Transaction Status
- Amount Paid In
- Amount Withdrawn
- Balance
This repository contains a comprehensive analysis of M-Pesa transaction data, offering insights into personal financial habits over a one-year period. The data was carefully cleaned, processed, and visualized to uncover trends in spending, income, savings, and overall financial health.
The dataset was sourced directly from Safaricom by dialing *334# and was initially provided in PDF format. The PDF was then converted into an Excel file for further analysis.
-
Excel:
-
Converted the PDF data into Excel format using I Love PDF.
-
Consolidated data from multiple sheets into a single, unified dataset.
-
Cleaned the dataset by removing unnecessary columns (e.g., "Receipt No." and "Completion Time") to focus on key financial details.
-
Transformed the data from its raw format to a structured format, ready for analysis: from this:

to this:
-
-
Power BI:
The data cleaning process involved the following steps:
-
Handling Redundant Columns:
- Removed columns such as "Receipt No." and "Completion Time" that were not necessary for the financial analysis.
-
Data Formatting:
- Ensured all data was correctly formatted, particularly dates and transaction amounts, to facilitate accurate analysis.
-
Final Dataset Preparation:
- Prepared the cleaned dataset for analysis by ensuring consistency across all entries and correcting any anomalies.
The exploratory data analysis (EDA) provided insights into various aspects of the financial data, helping to answer questions such as:
- What are the major spending categories?
- How does the balance change over time?
- Which months have the highest income or expenses?
- Descriptive Statistics: Calculated the mean, median, and total amounts for income and expenditures across different months.
- Transaction Categories: Identified and categorized transactions to determine spending patterns and income sources.
- The analysis showed that the majority of spending was on personal expenditures, with the least spent on transport.
- The highest balance was recorded in January 2024, while the lowest balance was in March 2024.
- December 2023 saw the highest spending, which corresponded with the highest income for the year.
- The largest savings were accumulated in December 2023.
- High Spending Months: December 2023 was identified as the month with the highest expenditures, driven largely by personal and holiday-related spending.
- Income Sources: 70% of income was derived from family contributions, with the remaining 30% from other sources such as money deposits.
- Savings Analysis: Significant savings were made in December 2023, highlighting a period of financial discipline following a high-income month.
- Spending Behavior: The analysis revealed a strong correlation between high income and increased spending in December 2023, suggesting a trend of spending based on available funds.
- Balance Trends: The fluctuating balance over the year provided insights into cash flow management, with notable peaks and troughs that align with major life events or financial decisions.
- Income Diversity: The reliance on family for 70% of income suggests potential areas for diversifying income sources to achieve greater financial independence.
The M-Pesa transaction analysis from July 2023 to July 2024 offers a detailed look into personal financial management, highlighting key spending habits and income sources. The insights gained can inform future financial decisions, helping to manage expenditures better and optimize savings.
Future analysis could explore:
- Deeper Spending Categorization: Breaking down spending into more granular categories to identify specific areas of overspending.
- Year-over-Year Comparison: Analyzing trends over multiple years to assess financial growth or areas of concern.
- Predictive Analysis: Using historical data to forecast future spending and balance trends.
- Clone the repository:
git clone https://github.com/Sandrakimiring/mpesa-statements-analysis.git
