Difference between the previous data and the current data

Hello Everyone:)

I want to find the difference between the previous data and the current data.
How can i make Diff Data??? (“HMI_Line_Diff” part of the table below)

This Project make by csv data. not Jira DB.
And Rows : Time
Columns : Measure

Please advise.

Line Hmi HMI_Line_Diff
Apr 26 2019 301,474 301,474
May 02 2019 301,443 -31
May 09 2019 304,264 2,821
May 14 2019 305,597 1,333
May 23 2019 310,325 4,728
May 31 2019 306,564 -3,761
Jun 05 2019 296,869 -9,695
Jun 18 2019 300,447 3,578
Jun 21 2019 300,705 258
Jun 22 2019 302,857 2,152
Jul 02 2019 308,314 5,457
Jul 24 2019 315,602 7,288
Jul 26 2019 316,196 594
Jul 29 2019 316,534 338
Aug 06 2019 316,535 1

Hi,

You could try creating the calculated measure with [Time].CurrentMember.PrevMember to find the difference between the current member and its previous sibling

[Measures].[Line Hmi]
-
(
  [Measures].[Line Hmi],
  [Time].CurrentHierarchyMember.PrevMember
)

Martins / eazyBI support

Hello @martins.vanags.
I tried as your advise, but i failed. Please check…

Hi,

Does it work if you remove “Version” dimension from your report?
And please select measures from “root members” list when changing the code for your calculated measure.
The measure names in the code for calculated measure seems strange.

Martins / eazyBI support

Hi @martins.vanags,

This report is not connected JIRA.
It make by .csv source data.

I try remove Version, but it same…
And HMI_Line is root members in Measure

Hi,
Can you please check what results do you see when you create another calculated measure using this code:

[Time].CurrentHierarchyMember.PrevMember.Name

Martins / eazyBI

1 Like

Hi. @martins.vanags
it is result. i think the reason is Time data is not match previous data date.
Thanks:)

image

Hi,

Try this code instead:

CASE WHEN 
[Measures].[Line Hmi]>0
AND
NOT([Time].CurrentHierarchyMember is [Time].CurrentHierarchyMember.level.Members.Item(0))
THEN
Nonzero((
 Tail(Filter(
   {
      [Time].CurrentHierarchyMember.level.Members.Item(0):
      [Time].CurrentHierarchyMember.PrevMember
      },
        [Measures].[Line Hmi] > 0
    )).Item(0),
    [Measures].[Line Hmi]
    ))
END

Martins / eazyBI

1 Like

@martins.vanags :slight_smile:

I did your advice, and the previous data was printed!
Make “original data - your advice data”, then we can see exact grapgh!!
Thank you!!

1 Like