Forum Discussion

Kym_EVO's avatar
Kym_EVO
Frequent Visitor
4 years ago
Solved

Like for Like Calculation Based on Weekly Data

Hi all,   Relatively new to DAX and building in PowerBI and would appreciate any help. We have multiple locations and I'm trying to calculate a weekly occupancy calculation depending on whether the...
  • AllisonKennedy's avatar
    AllisonKennedy
    4 years ago

    Kym_EVO 

     

    If you want to sum first, then divide, try this measure: 

     

    Like for Like Occ 3 =
    DIVIDE(
    SUMX('Sheet 1'
    , IF(RELATED('Centre Details'[Settlement Date]) + 365 <= MAX(DimDate[Date])
    ,'Sheet 1'[LDC Actual Occupancy]
    )
    )
    ,
    SUMX('Sheet 1'
    , IF(RELATED('Centre Details'[Settlement Date]) + 365 <= MAX(DimDate[Date])
    ,'Sheet 1'[LDC Licenced Occupancy]
    )
    )
    )