METHODOLOGY:
- Importing Data Import the "Loan Details" and "Borrower Details" sheets from the "bank loan.xlsx" file into Power BI.
- Transformation Using Power Query Data Cleaning: Handling Missing Values and Duplicates:
- Replace missing values (null) in the 'emp_ length' column of the "Borrower Details" table with '0 year'.
- Remove rows with missing values in the 'last_ pymnt_ d' and 'delinq_2yrs' columns.
- Remove duplicate rows in the 'id' column of the "Loan Details" table. Dealing with Inconsistencies:
- Ensure words in the 'purpose' column are separated by spaces instead of underscores (e.g., "credit card" instead of "credit_card").
- Format the 'purpose' and 'home_ownership' columns to proper case. Data Transformation: Column Transformation:
- Change the data type of the 'total_pymnt' column to 'Fixed decimal number'.
- Round off the numbers in the 'funded_amnt' column to 2 decimal places. Column Renaming:
- Rename the column 'issue_d' to 'issue_date'.
- Rename the column 'last_pymnt_d' to 'last_pymnt_date'. Creating New Columns:
- Create a new custom column named 'total_amount_paid' to calculate the total amount paid by each borrower by subtracting 'out_prncp' from 'total_pymnt'.
- Add a new conditional column named 'delinquency_status' to identify if the borrower has any delinquencies. If the number of delinquencies in 'delinq_2yrs' is greater than 0, the status should be "Delinquent", otherwise "Not Delinquent". Column Dropping:
- Remove the 'sub_grade' column as that does not significantly contribute to the analysis.
- Data Modeling:
- Identify the common column between both the tables and establish relationships between the two tables. Ensure the cross-filter direction is set to "Both". This step is crucial for enabling cross-table analysis and ensuring data integrity within the dataset.
- Creating Measures and Calculated Columns using DAX
- Create a new calculated column named 'remaining_installments' using DAX in the "BorrowerDetails" table to calculate the number of remaining installments by dividing the remaining principal amount ('out_prncp') by the monthly installment amount ('installment') and round up the result using the CEILING() function to account for any partial payments.
- Create a measure named 'Non-Verified Borrowers Count' using DAX to count the number of loans that have been 'Not Verified'.
- Create a measure named 'Fully Paid Loan Percentage' to calculate the percentage of fully paid loans. Divide the number of loans with a "Fully Paid" loan status by the total number of loans and then format this measure as Percentage.
Report 1: Loan Performance Analysis The Loan Performance Analysis report aims to provide insights into the performance of loans based on various factors such as loan amount, loan status, term, interest rate, and purpose.
-
Total Funded Amount: Create a card visual to display the total funded amount.
-
Fully Paid Loan Percentage: Create a gauge chart to display the 'Fully Paid Loan Percentage' measure.
-
Average Interest Rate by Term: Create a multi-row card to show the average interest rate for each term.
-
Loan Status Distribution: Create a pie chart to visualize the sum of total payments by loan status.
-
Loan Amount by Purpose: Create a treemap to show the average loan amount by purpose.
-
Installment Over Time: Create a line chart to visualize the sum of installments by Year and Quarter of the issue date.
-
Maximum Total Amount Paid by Loan Status: Create a column chart to display the maximum total amount paid by loan status.
-
Minimum Annual Income by Grade: Create a funnel chart to show the minimum annual income by grade.
-
Issue Date Slicer: Add a slicer for the Month of the issue date to enable dynamic data exploration.
Report 2: Borrower Profile Analysis The Borrower Profile Analysis report aims to provide insights into the characteristics of borrowers such as home ownership, annual income, employment length, verification status, debt-to-income ratio, and delinquency history.
-
KPI Visual: Create a KPI visual with the sum of total payment as the value, the year of last payment date as the trend axis, and the sum of loan amount as the target. Round off to 2 decimal points and format as $ currency.
-
Average of Annual Income: Display the average of annual income using a card visual.
-
Non-Verified Borrowers Count: Display the count of non-verified borrowers using a card visual.
-
Average Debt-to-Income by Delinquency Status: Create a multi-row card to show the average debt-to-income ratio by delinquency status.
-
Sum of Loan Amount by Home Ownership: Create a table to show the total loan amount by home ownership.
-
Average Remaining Principal by Verification Status: Create a donut chart to display the average remaining outstanding principal by verification status.
-
Sum of Delinquencies by Home Ownership: Create a bar chart to show the total number of delinquencies in the past 2 years by home ownership and filter the visual to display only Mortgage, Rent, and Own.
-
Max Remaining Installments by Employment Length: Create a treemap to show the maximum remaining installments by employment length.
-
Total Amount Paid and Funded Amount Over Time: Create a line chart to display the sum of total amount paid and the sum of funded amount by the year of last payment date.
-
Purpose Slicer: Add a slicer for loan purpose to enable dynamic data exploration.