Previous Status

Hi
I want to check the status immediately before through user define.
[Status].[Status].getMemberNameByKey(
[Issue].CurrentHierarchyMember.PrevMember.get(‘Status ID’)
) I expected to be able to check this way, but it doesn’t work. Is there any other way?

Function PrevMember can address the previous members within a hierarchy. Therefore, it will not work when you would like to address the previous Status value on the issue.

You would like to iterate through all historical statuses and compare the date of the last change to the last status updated date. Here is an example formula for this:

CASE WHEN
not IsEmpty([Issue].CurrentHierarchyMember.Get('Status updated at'))
THEN
Generate(Filter(
  [Transition Status].[Transition Status].Members,
  DateCompare(
  ([Measures].[Transition from status last date],
   [Time].CurrentHierarchy.DefaultMember),
   [Issue].CurrentHierarchyMember.GetDate('Status updated at')
  ) = 0
),
 [Transition Status].CurrentMember.Name, ",")
END

Here Is my report example with the measures Previous Status and Issue Status.

Daina / support@eazybi.com

In addition to this, here is a useful formula to calculate the historical status before a specific number of days (in example: 5 days ago)

CASE WHEN
not IsEmpty([Issue].CurrentHierarchyMember.Get('Status updated at'))
THEN
Order(
Filter(
  [Transition Status].[Transition Status].Members,
  (
    [Time].[Day].DateMember(DateAddDays([Time].[Day].CurrentDateMember.startdate,-5)), 
    [Measures].[Issues history]
  )>0
),
[Measures].[Transition from status last date],
BDESC
).item(0).getCaption
END

Martins / eazyBI