Categories: DAX
Tags:
Real Estate - Housing - DAX Questions - Part 2-1

Here are 10 intermediate-to-advanced DAX questions based on your Housing dataset, along with complete DAX solutions. All questions use the table Housing.

Exploratory Analysis and Dataset are given here: Power-bi-tutorial-real-estate-housing-price-analysis-complete-guide


1️⃣ Create a measure to calculate the Average Price of Furnished Houses Only

Solution

Avg Price Furnished :=
CALCULATE(
    AVERAGE(Housing[price]),
    Housing[furnishingstatus] = "furnished"
)

2️⃣ Calculate the % of Houses With a Basement

Solution

Basement Percentage :=
VAR TotalHouses = COUNTROWS(Housing)
VAR HousesWithBasement =
    CALCULATE(COUNTROWS(Housing), Housing[basement] = "yes")
RETURN
DIVIDE(HousesWithBasement, TotalHouses, 0)

3️⃣ Find the Average Price for Houses That Have Both Air Conditioning AND Parking > 1

Solution

Avg Price AC and Parking :=
CALCULATE(
    AVERAGE(Housing[price]),
    Housing[airconditioning] = "yes",
    Housing[parking] > 1
)

4️⃣ Count How Many Houses Have More Than the Average Area

(Uses VAR + AVERAGEX)

Solution

Houses Above Avg Area :=
VAR AvgArea = AVERAGEX(Housing, Housing[area])
RETURN
CALCULATE(
    COUNTROWS(Housing),
    Housing[area] > AvgArea
)

5️⃣ Create a measure that returns the Average Price by FurnishingStatus excluding unfurnished property

Solution

Avg Price Excluding Unfurnished :=
CALCULATE(
    AVERAGE(Housing[price]),
    Housing[furnishingstatus] <> "unfurnished"
)

6️⃣ Calculate Price per Square Foot for the Current Filter Context

Solution

Price Per SqFt :=
DIVIDE(
    SUM(Housing[price]),
    SUM(Housing[area])
)

7️⃣ Create a Ranking Measure for Houses Based on Price (Descending Rank)

(Advanced RANKX)

Solution

House Price Rank :=
RANKX(
    ALL(Housing),
    CALCULATE(SUM(Housing[price])),
    ,
    DESC,
    Dense
)

8️⃣ Measure: Calculate the Average Price of Houses on Main Road Compared to Not on Main Road

(Difference between two CALCULATE blocks)

Solution

Price Difference Mainroad :=
VAR MainRoadPrice =
    CALCULATE(AVERAGE(Housing[price]), Housing[mainroad] = "yes")
VAR NonMainRoadPrice =
    CALCULATE(AVERAGE(Housing[price]), Housing[mainroad] = "no")
RETURN
MainRoadPrice - NonMainRoadPrice

9️⃣ Create a measure that returns the count of houses where BOTH guestroom AND basement are “yes”

Solution

Guestroom and Basement Count :=
CALCULATE(
    COUNTROWS(Housing),
    Housing[guestroom] = "yes",
    Housing[basement] = "yes"
)

🔟 Calculate Price Weighted by Number of Bedrooms

(Weighted average using SUMX)

Solution

Weighted Price by Bedrooms :=
DIVIDE(
    SUMX(Housing, Housing[price] * Housing[bedrooms]),
    SUM(Housing[bedrooms])
)

If you want, I can also create:

✔ More advanced DAX
✔ DAX interview questions
✔ Power BI dashboard practices
✔ ML model preparation questions (feature engineering)

Just tell me!