Forum Discussion
pull values down
Anonymous , ty for reply!
All is working fine, but a little bit slow.
Can you explain me how can i filtered this rows? Only the current line (with original value) and previous line needs to be left. The end result should look like:
Hi Bessonnizza1992,
My formula is included iterator calculation, if you are handling huge amount of records, it may reduce the performance.
>>Can you explain me how can i filtered this rows? Only the current line (with original value) and previous line needs to be left.
I'm not so clear about your requirement, can you please explain more about this? Did you mean the expression should end the calculate if they executed to the end of your fact table records?
If this is a case, you can add an if statement to package this expression to prevent the calculation on not existed date range:
Measure =
VAR _lastDate =
MAXX ( ALLSELECTED ( Statistics ), [Timestamp] )
VAR currDate =
MAX ( CalendarTime[Time] )
VAR prev =
CALCULATE (
MAX ( Statistics[Timestamp] ),
FILTER ( ALLSELECTED ( Statistics ), [Timestamp] <= currDate )
)
RETURN
IF (
currDate <= _lastDate,
CALCULATE (
MAX ( Statistics[Value] ),
FILTER ( ALLSELECTED ( Statistics ), [Timestamp] = prev )
)
)
Regards,
Xiaoxin Sheng