Forum Discussion
Kym_EVO
4 years agoFrequent Visitor
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...
- 4 years ago
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])))
AllisonKennedy
4 years agoCommunity Champion
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]
)
)
)
Kym_EVO
4 years agoFrequent Visitor
Thanks very much AllisonKennedy. This second solution worked as it's a percentage calculation so the other solution summed the percentages but this solution gives a total percentage.
Appreciate the help!