I want to multiply 2 measures and then get the sum of them. One measure can be empty at times which makes the calculation wrong.
Please see the attachment, I’m multiplying values Col1Col2 into Col3.
But the sum of Col 3 is shown as Sum Col1 Sum Col2, insted of 200 which is the actual sum of values under Col 3.
Script used for test 1 (Col 3)
CASE WHEN [Measures].[Crew Hours On Site created] = 0 THEN 0 WHEN NOT IsEmpty([Measures].[Crew Hours On Site created]) THEN
** [Measures].[Crew Hours On Site created]***
** [Measures].[Crew Size created]** END
CASE WHEN [Measures].[Crew Hours On Site created] = 0 THEN 0
WHEN NOT IsEmpty([Measures].[Crew Hours On Site created])
THEN
[Measures].[Crew Hours On Site created]*
[Measures].[Crew Size created]
END
For each row, the calculated measure multiplies “Crew Hours On Site created” and “Crew Size created” values that are on that same row. Like in your example, 10.00 * 5.00 = 50.00.
By default, the same logic works for the Total row, it multiplies the two values, “Crew Hours On Site created” and “Crew Size created”, which are on the Total row. In other words, the order of mathematical operations is first sum up Total for each measure separately and then multiply those values.
-- annotations.total=sum
CASE WHEN [Measures].[Crew Hours On Site created] = 0 THEN 0
WHEN NOT IsEmpty([Measures].[Crew Hours On Site created])
THEN
[Measures].[Crew Hours On Site created]*
[Measures].[Crew Size created]
END
This option to change Total row behavior with annotation is available from eazyBI version 6.0.1 and on Cloud.