Power BI Exercise - Retail Sales Dataset
Power BI Exercise - Retail Sales Dataset
Preview and download it as a CSV file for Power BI.
Exercise objectives
- Understand the basic structure of a JSON array.
- Use JavaScript to display JSON records in an HTML table.
- Convert the same records into CSV format.
- Download the generated CSV and import it into Power BI Desktop.
Step 1: Sample dataset in JSON
The sample dataset is embedded in this exercise. It contains 15 retail sales records, with each record representing one transaction.
Step 2: Dataset preview
The table below displays the 15 transactions that will be included in the downloadable CSV file.
Verify dataset
Use Power BI Desktop to verify that the downloaded file is complete and that every column has the correct data type.
1. Import the CSV file
- Select Download sales_data.csv above.
- Open Power BI Desktop.
- Select Home → Get data → Text/CSV.
- Select the downloaded sales_data.csv file.
- Review the preview and select Load.
- In the Data pane, rename the imported table to Sales.
2. Verify the column data types
| Column | Required data type |
|---|---|
| SaleID | Whole number |
| SaleDate | Date |
| Product | Text |
| Category | Text |
| Region | Text |
| Channel | Text |
| Quantity | Whole number |
| UnitPrice | Fixed decimal number |
| SalesAmount | Fixed decimal number |
3. Confirm the control values
15Rows
9Columns
RM21,788Total SalesAmount
0Blank or error values
4. Create a verification table
- Open Report view.
- Add a Table visual to the report canvas.
- Add Product, Category, Quantity, and SalesAmount.
- Check that all 15 transactions can be viewed.
- Confirm that the total shown for SalesAmount is RM21,788.
Verification complete: Continue only when the table contains 15 rows, nine columns, no errors, and a SalesAmount total of RM21,788.
Suggested first Power BI tasks
- Create a table visual using Product, Category, Quantity, and SalesAmount.
- Create a column chart showing SalesAmount by Category.
- Create a card displaying the total SalesAmount.
- Add Region and Channel slicers.
- Check that the total SalesAmount is RM21,788.