Forum Discussion
Multiplication with measure
- Anonymous8 years ago
Anonymous,
In your table, you have different SpeedM/S for different Stationary Objects. You would need to create a measure to calculate a average speed value, then calculate distance between objects.
TimeDifference = MAX(Table1[time])-MIN(Table1[time])
AverageSpeed = AVERAGE(Table1[SpeedM/S])
OutputMeasure = [TimeDifference]*[AverageSpeed]
Regards,
Lydia
Hi bsas,
This measure works but I am getting unexpected results from it.
For example when the time difference is 0:05:00 the number that comes out of my measure is 0,50 while the speed in that difference was around 26 Meter per second.
Am I doing something wrong ?
The thing I am trying to achieve here is to know the distance covered in that time
Anonymous
Could you please share sample of your data table.
- Anonymous8 years agoNot applicable
Time StationaryObject SpeedMS MovingObject 10:00:00 A 20 X 10:10:00 C 20 X Timedifference represents the time between StationaryObject A and C for example. So in this case Timedifference would be 00:10:00. the expected outcome would be the distance traveled by the moving object between those points
The column "Time" we see here is a calculated column which displays an average of when the MovingObject was at StationaryObject
there is also a column with Speed in KMH "SpeedKMH" which is a normal column not a calculated one
- bsas8 years agoPost Patron
Anonymous
What is the format of time you're using?
00:10:00 - means 10 min or sec?
- Anonymous8 years agoNot applicable
- Anonymous8 years agoNot applicable
Anonymous,
Create a calculated column using the formula below.
Column = MINUTE(Table1[Time])*60+SECOND(Table1[Time])
Then create the following measures in your table.
TimeDifference = Max(Table1[Column])- MIN(Table1[Column])
OutputMeasure = [TimeDifference]*VALUES(Table1[SpeedMS])
Regards,
Lydia- Anonymous8 years agoNot applicable
I followed the exact steps and the measure that turns time into seconds as a number works perfectly, the problem I have now is that the "outputmeasure" in Anonymous gives the following error when I try to display it in a visual:
"Calculation error in measure [outputmeasure]: A table of multiple values was supplied where a single value was expected"
the measure itself works but I can't get it to display something ..
Regards, L.Meijdam (excuses for the late response)