
π Dataset Description: Electrical Appliances Sales vs Temperature
This dataset contains 100 records of synthetic sales data for various electrical appliances sold across North Indian cities over a 2-year period (2023β2024). The data reflects seasonal demand trends by associating daily sales activity with temperature conditions, mimicking real-world seasonal buying behavior.
ποΈ Key Features:
- Date β The date of the transaction
- City β The city where the sale occurred (e.g., Delhi, Lucknow)
- Store β Store identifier (e.g., Store_1 to Store_10)
- Category β Appliance category (e.g., AC, Heater, Fan, Geyser)
- Product β Specific product name (e.g., CoolBreeze AC, AquaHot)
- Quantity_Sold β Number of units sold
- Unit_Price β Price per unit (in INR)
- Discount_% β Discount applied on the revenue
- Revenue β Total amount before discount
- Final_Price β Net sale amount after discount
- Temperature_C β Approximate outdoor temperature (Β°C) on the sale day
Get the dataset here : https://github.com/slidescope/electrical-and-electronics-sales-vs-temperature
This dataset is suitable for seasonal trend analysis, sales forecasting, temperature-sensitive product insights, and practicing advanced DAX / Power BI measures.
DAX Practice questions based on dataset, ideal for Power BI or Excel Power Pivot analysis.
β Dataset Columns Recap
Date,City,Store,Category,ProductQuantity_Sold,Unit_Price,Discount_%,Revenue,Final_Price,Temperature_C
π Question 1: What is the total revenue generated in Summer months (May to July) vs Winter months (December to February)?
β DAX Answer:
SummerRevenue :=
CALCULATE(
SUM('Sales'[Revenue]),
MONTH('Sales'[Date]) IN {5, 6, 7}
)
WinterRevenue :=
CALCULATE(
SUM('Sales'[Revenue]),
MONTH('Sales'[Date]) IN {12, 1, 2}
)
π‘ Explanation:
- Uses
MONTH()to filter based on seasonal months. CALCULATEmodifies the context to include only specific months.- Can be visualized in a comparison bar chart.
π Question 2: Which city has the highest average temperature on days when ACs were sold?
β DAX Answer:
AvgTemp_AC_Sales :=
CALCULATE(
AVERAGE('Sales'[Temperature_C]),
'Sales'[Category] = "AC"
)
To find the top city, create a measure and add a visual filtered by City and sort descending.
π‘ Explanation:
- Filters the context to only “AC” category.
- Averages the temperature during those sales.
- City with the max of this measure gives the answer.
π Question 3: Calculate the total discount value given per category.
β DAX Answer:
Total_Discount_Value :=
SUMX(
'Sales',
('Sales'[Revenue] * 'Sales'[Discount_%]) / 100
)
π‘ Explanation:
SUMXevaluates row by row.- Multiplies revenue by discount percent for each row, then sums it.
- Can be used in a matrix with Category as row.
π Question 4: What is the month-over-month growth in Final Sales Price?
β DAX Answer:
MonthlyFinalSales :=
CALCULATE(
SUM('Sales'[Final_Price]),
DATESINPERIOD('Sales'[Date], MAX('Sales'[Date]), -1, MONTH)
)
MoM_Growth :=
DIVIDE(
[Final Sales This Month] - [MonthlyFinalSales],
[MonthlyFinalSales],
0
)
Youβll need a Date table and a measure like:
Final Sales This Month = SUM('Sales'[Final_Price])
π‘ Explanation:
- Measures the change in Final Sales month over month.
- Uses
DATESINPERIOD()for time intelligence. DIVIDE()handles divide-by-zero errors.
π Question 5: Find the best-selling product category (by Final Price) in high-temperature days (above 40Β°C).
β DAX Answer:
HighTemp_Sales :=
CALCULATE(
SUM('Sales'[Final_Price]),
'Sales'[Temperature_C] > 40
)
Add this to a visual grouped by
Categoryand sort descending to find the top.
Time Intelligence Functions
MoM Sales = CALCULATE([Total Sales], DATEADD('Date'[Date], -1, MONTH))
MoM % =
DIVIDE(
[Total Sales] - [MoM Sales],
[MoM Sales],
0
)
π‘ Explanation:
- Filters rows where
Temperature_C > 40. - Calculates total final sales on hot days (likely summer).
- Useful for seasonality-based product planning.
