Forum Discussion
Bessonnizza1992
5 years agoHelper I
Time Intelegence
I have an array of data where Value can only be in two states 1 or 0. Each value has its own timestamp of the event change from 1 to 0, etc. When i build line chart PowerBI return me this: ...
- 5 years ago
Anonymous PBI freezes too with this measure:(
I tried to use a different construction, now everything is fine. Ty for help!
Measure = VAR currDate = MAX ( CalendarTime[Time] ) VAR prev = CALCULATE ( MAX ( Statistics[Timestamp] ), FILTER ( ALLSELECTED ( Statistics ), [Timestamp] <= currDate ) ) RETURN CALCULATE ( MAX ( Statistics[Value] ), FILTER ( ALLSELECTED ( Statistics ), [Timestamp] = prev ) )
Anonymous
5 years agoNot applicable
Hi Bessonnizza1992 ,
I updated your sample pbix file, please check whether that is what you want. I create a measure as below to get the values:
Measure =
VAR _curtime =
MAX ( 'CalendarTime'[Time] )
VAR _curvalue =
CALCULATE (
MAX ( 'Statistics'[Value] ),
FILTER ( 'Statistics', 'Statistics'[Timestamp] = _curtime )
)
VAR _pretime =
CALCULATE (
MAX ( 'Statistics'[Timestamp] ),
FILTER (
ALL ( 'Statistics' ),
'Statistics'[Timestamp] < _curtime
)
)
VAR _prevalue =
CALCULATE (
MAX ( 'Statistics'[Value] ),
FILTER ( ALL ( 'Statistics' ), 'Statistics'[Timestamp] = _pretime )
)
RETURN
IF ( ISBLANK ( _curvalue ), _prevalue, _curvalue )Best Regards
Rena
Bessonnizza1992
5 years agoHelper I
Anonymous PBI freezes too with this measure:(
I tried to use a different construction, now everything is fine. Ty for help!
Measure =
VAR currDate =
MAX ( CalendarTime[Time] )
VAR prev =
CALCULATE (
MAX ( Statistics[Timestamp] ),
FILTER ( ALLSELECTED ( Statistics ), [Timestamp] <= currDate )
)
RETURN
CALCULATE (
MAX ( Statistics[Value] ),
FILTER ( ALLSELECTED ( Statistics ), [Timestamp] = prev )
)
- Anonymous5 years agoNot applicable
Hi Bessonnizza1992 ,
It's glad to hear that your problem has been resolved. And thanks for sharing your solution for us. Thank you.
Best Regards
Rena