Measure does not calculate value for all areas

Hi @leo_89

Your issue can be solved by using the Fix Incorrect Totals pattern. For more information, you can review this post:

Once a virtual table is added, the values sum as per your sample.


To see this in action, I created a “Detail” table that showed you measure accurately calculated the value per event, but when the event context is removed and you want the summarized value for each area, you need to add a virtual table. Here’s one measure that seems to match your expected values:

Measure 2 = 
VAR _YearOfCancelDate = YEAR( MAX( 'Table'[Cancelled Date (NZST)] ) ) 
VAR _EventType = MAX( 'Table'[EventType] ) 
VAR _vTable = ADDCOLUMNS(
    SUMMARIZE( 'Table','Table'[Area] ),
    "@ConsumerMinutes", SUM( 'Table'[TotalConsumerMinutes] )
) 
VAR _Result = 
-- IF( 
-- _YearOfCancelDate > 1900 && _EventType = 3 , 0 , 
CALCULATE( SUMX( _vTable , ( [@ConsumerMinutes] / 91577 ) ) )
-- )

RETURN
_Result

I’m not sure about the IF statement, so I left it commented-out. But this should give you the idea.

Hope it helps.
Greg
eDNA Forum - Measure Value for All Areas.pbix (680.0 KB)

1 Like