Tags:
sales vs temperature

πŸ“„ 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, Product
  • Quantity_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.
  • CALCULATE modifies 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:

  • SUMX evaluates 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 Category and 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.