Forum Discussion

datagoblin77's avatar
datagoblin77
Frequent Visitor
2 years ago

Matrix not displaying values

Hello, 

I am working on a model I did not create. The model looks at residental unit availability across a university. However, when there are no move-in or move-outs in the week, the matrix I created does not show the number of occupied units. For example on 5/26 and 6/9, I get no values (because that week features no move ins and move outs.


Here are some features of the model.
I have a dim_date table that looks 12 weeks into the future. 
The  total units are calculated with:
Total Units:=DISTINCTCOUNT(Fact_Units[Unit ID])
The total occupied units are calculated with:

Total Actual Occupied Units:=
CALCULATE(
            DISTINCTCOUNT(
                         Fact_Units[Unit ID]),FILTER(Fact_Units,Fact_Units[Occupancy Flag] = "Yes"),   
                          FILTER(Dim_ProjectionsDate,Dim_ProjectionsDate[Projection Week Ending]<=MAX(Dim_ProjectionsDate[Projection                            Week Starting])))+0


The week to week projected 
Total Projected Move-Ins:= CALCULATE(DISTINCTCOUNT(Fact_Projections[Unit ID]), FILTER(Fact_Projections, Fact_Projections[Move In/Move Out] = "Move-In"))+0
Total Projected Move-Outs:= CALCULATE(DISTINCTCOUNT(Fact_Projections[Unit ID]), FILTER(Fact_Projections, Fact_Projections[Move In/Move Out] = "Move-Out"))+0

Then we calculate the week to week occupancy.

DIM_Total Projected Occupied Units:= IF(AND([Total Projected Move-Ins] = 0, [Total Projected Move-Outs] = 0), BLANK(), CALCULATE([DIM_Week Beginning Occup]+ [Total Projected Move-Ins] - [Total Projected Move-Outs]))

The BLANK() as the true condition is because in a previous iteration of the model, the matrix would arbitrarily put the initial value (total actual occupied units) 
 
I would like to change that BLANK() to the last "viable" value. 

Can anyone help?


 

2 Replies