Hi,
I wanted to work out the change in a value for the mileage of each vehicle over the month and the average that.
I eventually came up with a measure like this.
[Average Mileage] :=
AVERAGEX (
VALUES ( Date[VehicleID ] ),
CALCULATE ( MAX ( Data[Mileage] ) - MIN ( Data[Mileage] ) )
)
I can understand at a high level what is going on? But I am keen to understand more specifically, in particular why the CALCULATE is needed. I guess I don't understand why I am in a row context that needs to be converted to a filter context.
Thanks
Gary
I wanted to work out the change in a value for the mileage of each vehicle over the month and the average that.
I eventually came up with a measure like this.
[Average Mileage] :=
AVERAGEX (
VALUES ( Date[VehicleID ] ),
CALCULATE ( MAX ( Data[Mileage] ) - MIN ( Data[Mileage] ) )
)
I can understand at a high level what is going on? But I am keen to understand more specifically, in particular why the CALCULATE is needed. I guess I don't understand why I am in a row context that needs to be converted to a filter context.
Thanks
Gary