Forum Discussion
krzysj13
5 years agoRegular Visitor
Values between 2 dates
Hello, I'm looking the way to make new column in left table, with value from right column 'AlarmID', if its between 2 dates - LOCALTIME and Previous. Thanks alot in advance for help.
- 5 years ago
krzysj13, try this calculated column in the left table:
Alarm ID = VAR vAlarms = FILTER ( Alarms, Alarms[Start Time] > Main[Previous] && Alarms[Start Time] <= Main[Local Time] ) VAR vResult = MAXX ( vAlarms, Alarms[Alarm ID] ) RETURN vResultLeft table: Main
Right table: Alarms
DataInsights
5 years agoSuper User
krzysj13, try this calculated column in the left table:
Alarm ID =
VAR vAlarms =
FILTER (
Alarms,
Alarms[Start Time] > Main[Previous]
&& Alarms[Start Time] <= Main[Local Time]
)
VAR vResult =
MAXX ( vAlarms, Alarms[Alarm ID] )
RETURN
vResult
Left table: Main
Right table: Alarms
krzysj13
5 years agoRegular Visitor
Hey, thanks for the answer, but I have one more question, what if I have 2 alarms in 1 period of time?