staceyeileen
New Member
- Joined
- Dec 17, 2012
- Messages
- 3
Hello folks,
I am new to PowerPivot and having some difficulty with a measure I am trying to create. I am dealing with a very large data set (hence, why I turned to PP) that involves temperature readings of various locations in a manufacturing facility. Temperature readings are captured every 15 minutes via temperature probes in various locations. Here is the simplified model...
Locations table:
Name ProbeNumber
Loc1 17
Loc2 17
Loc3 20
Loc4 31
Probes table:
ProbeNumber Name
17 ProbeA
20 ProbeB
31 ProbeC
Readings table:
Timestamp ProbeNumber Reading
12/15/12 08:00 17 -25.33
12/15/12 08:10 20 -33.15
12/15/12 08:15 17 -27.50
12/15/12 08:15 31 -39.00
12/15/12 08:25 20 -32.25
etc, etc (millions of rows)
Finally, I have a table that tracks the movement of products throughout the facility as it moves in and out of various locations, named Movement.
Serial# Location TimeIn TimeOut
123 Loc4 12/10/12 08:08 12/16/12 13:40
123 Loc1 12/16/12 13:40 12/15/12 22:45
456 Loc2 12/12/12 12:35 12/15/12 08:22
I want to calculate the max temp in the Readings table that corresponds to a given row in the Movement table. I had already added a calculated column for MaxTemp in the Movement table that seems to be working using MAXX, but this was before I discovered what a Measure is and the fact that you can only create KPIs off measures. I'm not sure how to adapt my calculated column formula to create a MaxTemp measure:
=MAXX(FILTER(Readings,
Readings[Timestamp] >=[TimeIn] &&
Readings[Timestamp] <= [TimeOut] &&
Readings[ProbeNumber] = RELATED(Locations[ProbeNumber])) ,
Readings[Reading])
Everything I've tried using CALCULATE and MAX has thrown an error about not being able to determine the context of a field. Your help is greatly appreciated!
I am new to PowerPivot and having some difficulty with a measure I am trying to create. I am dealing with a very large data set (hence, why I turned to PP) that involves temperature readings of various locations in a manufacturing facility. Temperature readings are captured every 15 minutes via temperature probes in various locations. Here is the simplified model...
Locations table:
Name ProbeNumber
Loc1 17
Loc2 17
Loc3 20
Loc4 31
Probes table:
ProbeNumber Name
17 ProbeA
20 ProbeB
31 ProbeC
Readings table:
Timestamp ProbeNumber Reading
12/15/12 08:00 17 -25.33
12/15/12 08:10 20 -33.15
12/15/12 08:15 17 -27.50
12/15/12 08:15 31 -39.00
12/15/12 08:25 20 -32.25
etc, etc (millions of rows)
Finally, I have a table that tracks the movement of products throughout the facility as it moves in and out of various locations, named Movement.
Serial# Location TimeIn TimeOut
123 Loc4 12/10/12 08:08 12/16/12 13:40
123 Loc1 12/16/12 13:40 12/15/12 22:45
456 Loc2 12/12/12 12:35 12/15/12 08:22
I want to calculate the max temp in the Readings table that corresponds to a given row in the Movement table. I had already added a calculated column for MaxTemp in the Movement table that seems to be working using MAXX, but this was before I discovered what a Measure is and the fact that you can only create KPIs off measures. I'm not sure how to adapt my calculated column formula to create a MaxTemp measure:
=MAXX(FILTER(Readings,
Readings[Timestamp] >=[TimeIn] &&
Readings[Timestamp] <= [TimeOut] &&
Readings[ProbeNumber] = RELATED(Locations[ProbeNumber])) ,
Readings[Reading])
Everything I've tried using CALCULATE and MAX has thrown an error about not being able to determine the context of a field. Your help is greatly appreciated!