0
0
Power BIbi_tool~15 mins

CSV and text file import in Power BI - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants you to analyze last quarter's sales data which is stored in CSV and text files. You need to import these files into Power BI to create reports.
📊 Data: You have two files: 'SalesData.csv' containing sales transactions with columns Date, Product, Region, and SalesAmount; and 'ProductInfo.txt' containing product details with columns ProductID, ProductName, and Category separated by tabs.
🎯 Deliverable: Import both files into Power BI, combine the data properly, and prepare it for creating sales reports.
Progress0 / 6 steps
Sample Data
DateProductRegionSalesAmount
2024-01-05P1001North250
2024-01-06P1002South180
2024-01-07P1003East300
2024-01-08P1001West220
2024-01-09P1002North190
2024-01-10P1003South310
2024-01-11P1001East260
2024-01-12P1002West200
ProductIDProductNameCategory
P1001Wireless MouseAccessories
P1002USB KeyboardAccessories
P1003HD MonitorDisplays
1
Step 1: Open Power BI Desktop and start a new report.
No formula needed.
Expected Result
Power BI Desktop is ready for data import.
2
Step 2: Import the 'SalesData.csv' file.
Home tab > Get Data > Text/CSV > Select 'SalesData.csv' > Load
Expected Result
SalesData table is loaded with columns Date, Product, Region, SalesAmount.
3
Step 3: Import the 'ProductInfo.txt' file with tab delimiter.
Home tab > Get Data > Text/CSV > Select 'ProductInfo.txt' > In preview, set delimiter to Tab > Load
Expected Result
ProductInfo table is loaded with columns ProductID, ProductName, Category.
4
Step 4: Check data types for both tables and correct if needed.
In Power Query Editor, verify Date is date type, SalesAmount is number, ProductID and Product are text.
Expected Result
Data types are correct for analysis.
5
Step 5: Create a relationship between SalesData and ProductInfo tables on Product and ProductID columns.
Model view > Drag 'Product' from SalesData to 'ProductID' in ProductInfo
Expected Result
Relationship is active and many-to-one from SalesData to ProductInfo.
6
Step 6: Close Power Query Editor and apply changes.
Click 'Close & Apply' button
Expected Result
Data is loaded into Power BI model ready for report building.
Final Result
-----------------------------------------
| Sales Report Dashboard                 |
|---------------------------------------|
| Region | Total Sales | Top Product    |
|---------------------------------------|
| North  | $440        | Wireless Mouse |
| South  | $490        | HD Monitor     |
| East   | $560        | HD Monitor     |
| West   | $420        | Wireless Mouse |
-----------------------------------------
East region has the highest total sales.
HD Monitor is the top-selling product in South and East regions.
Wireless Mouse leads sales in North region.
Wireless Mouse leads sales in West region.
Bonus Challenge

Create a calculated column in SalesData to categorize sales as 'High' if SalesAmount > 250, else 'Low'.

Show Hint
Use Power Query Editor or DAX formula: SalesCategory = IF(SalesData[SalesAmount] > 250, "High", "Low")