Forum Discussion
Occupance by datetime
- 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.
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])
Hi lbendlin ,
I don't need to filter on the ID, I use a slicer for this. I need to filter on de time, please take a look at my picture that I have posted in the previous post. I want to recreate the right table, in the image, with the data that is on the left.
- lbendlin6 years agoSuper User
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.
- Anonymous6 years agoNot applicable
Thank you, I have managed to create the table that I would like to have with a filter. Stupid of me to not think about that.