Forum Discussion

BaratheShubham's avatar
BaratheShubham
Regular Visitor
8 months ago
Solved

undefined

I want to plot an area chart quarter wise for 2024 and 2025 with respect to vacant and occupied units. In this case the total units for a property will be same since the total (physical) units are not changing. I want to show property wise changes in vacant and occupied units count.

 

6 Replies

  • Hi BaratheShubham ,
    To visualize property-wise changes where the Total Units are constant, but the Vacant/Occupied mix changes, I recommend using the Stacked Area Chart combined with the Small Multiples feature.

    1. The Data Model:- 

    Ensure your data table (e.g., 'PropertyData') is set up correctly. You likely have one of two structures:

    • Structure A (Unpivoted): Columns like [Date], [Property], [Status] (values: "Occupied", "Vacant"), and [UnitCount].

    • Structure B (Pivoted): Columns like [Date], [Property], [VacantCount], and [OccupiedCount].

    2. Dax

    Measure for Occupied Units
    Occupied Units =
    CALCULATE(
    SUM('PropertyData'[UnitCount]),
    'PropertyData'[Status] = "Occupied"
    )
    Measure for Vacant Units
    Vacant Units =
    CALCULATE(
    SUM('PropertyData'[UnitCount]),
    'PropertyData'[Status] = "Vacant"
    )

    3. Visual Configuration (Stacked Area Chart)

    Select the Stacked Area Chart visual and configure the fields as follows:

    • X-Axis: Date field (Drag it in and use the Hierarchy to show Year and Quarter). Filter for 2024 & 2025.

    • Y-Axis: Drag both [Occupied Units] and [Vacant Units] here.

    • Small Multiples: Drag your [Property Name] field here.

     

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

    💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

    🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

    🔗 Curious to explore more? [Discover here].

    Let’s keep building smarter solutions together!

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Keep total units fixed per property and aggregate by quarter. For each quarter you only need occupied units, vacant units are the remainder. Then use a stacked area chart by quarter, filtered by property.

    Example DAX:

    Occupied Units :=
    SUM ( internal[OccupiedUnits] )

    Vacant Units :=
    SUM ( internal[TotalUnits] ) - [Occupied Units]

    Quarter :=
    "Q" & FORMAT ( internal[Created time], "Q" ) & " " & FORMAT ( internal[Created time], "YYYY" )

    In the area chart: put Quarter on the x-axis, Occupied Units and Vacant Units as values, and filter or facet by Property. This will show quarter-wise shifts between occupied and vacant units while total units stay constant.