Forum Discussion
Anonymous
6 years agoNot applicable
Occupance by datetime
Hi all, I am trying to create a calculation based on the amount of persons that are in a room based on two datetime field. I have a date table and another table that looks like this: ID In ...
- 6 years ago
When you create measures you have to think about filter context and the type of visual you want to use. A good measure works in one scenario. A great measure works in multiple scenarios, including Totals.
lbendlin
6 years agoSuper User
Occupancy :=
var i = max(Occupancy[ID])
return CALCULATE(sum(Occupancy[In])-sum(Occupancy[Out]),allselected(Occupancy),Occupancy[ID]<=i)
or for the CalcuHaters:
Occupancy := sumx(FILTER(allselected(Occupancy),Occupancy[ID]<=max(Occupancy[ID])),Occupancy[In]-Occupancy[Out])
BA_Pete
6 years agoSuper User
Please define CalcuHater.
I'm pretty sure I need this word in my life but must understand the etymology 😄
Pete