It shows each weeks correctly, but when I add the automatic Row total, the total is incorrect, it shows the Total amount of created issues ever, and not the amount of issues created for that period of time.
@martins.vanags
This worked!
But now I have a different issue.
I also need the Change % and Averages.
I tried a few different approaches for the change% and the Total is always the Sum of all the change % instead of being change% of the 2 totals
The same happens for the average where the total is the SUM of every line
(
[Measures].[Issues created],
[Time].CurrentHierarchyMember.Lag(9) --counting starts from 0
)
Issues Created 8 Weeks Ago Change%
CASE WHEN (NOT IsEmpty([Measures].[Issues Created 8 weeks ago]) OR
DateCompare([Time].CurrentHierarchyMember.StartDate, Now()) < 0
) AND
( [Measures].[Issues Created 8 weeks ago],
[Time].CurrentHierarchyMember.Lag(9) --counting starts from 0
) <> 0
THEN
[Measures].[Issues Created 8 weeks ago] /
( [Measures].[Issues Created 8 weeks ago],
[Time].CurrentHierarchyMember.Lag(9) --counting starts from 0
) - 1
END
For Average Created Issues 8 Weeks Ago, I use the precalculated Calculated > Statistical > Average
Try this code for “Issues created 8 weeks ago change %” calculation
CASE WHEN
[Time].CurrentHierarchyMember.Name = '$total_aggregate'
THEN
SUM(
VisibleRowsSet(),
[Measures].[Issues created]
)
/
SUM(
VisibleRowsSet(),
(
[Measures].[Issues Created],
[Time].CurrentHierarchyMember.Lag(9) --counting starts from 0
)
)
-
1
ELSE
CASE WHEN
(NOT IsEmpty([Measures].[Issues Created 8 weeks ago]) OR
DateCompare([Time].CurrentHierarchyMember.StartDate, Now()) < 0
) AND
( [Measures].[Issues Created],
[Time].CurrentHierarchyMember.Lag(9) --counting starts from 0
) <> 0
THEN
[Measures].[Issues Created] /
(
[Measures].[Issues Created],
[Time].CurrentHierarchyMember.Lag(9) --counting starts from 0
)
-1
END
END
I have a problem with the total for my Average 8 Weeks Ago. It shows the total number of issues instead of the average.
I used the pre-calculated Average. Here is the Query
CASE WHEN NOT IsEmpty([Measures].[Issues Created 8 weeks ago]) THEN
CatchException(
Avg(VisibleRowsSet(), [Measures].[Issues Created 8 weeks ago])
)
END
Try this formula for the last column in your report:
CASE WHEN
[Time].CurrentHierarchyMember.name = '$total_aggregate'
THEN
Avg(
Filter(
VisibleRowsSet(),
[Measures].[Issues Created 8 weeks ago]>0
),
[Measures].[Issues Created 8 weeks ago]
)
ELSE
CASE WHEN
NOT IsEmpty([Measures].[Issues Created 8 weeks ago])
THEN
Avg(VisibleRowsSet(), [Measures].[Issues Created 8 weeks ago])
END
END