I am creating a measure that sum up the count of events failures if count of event failure passes certain threshold value (let say 3) and failure event occured on the same location, same cause, and same equipment involved and happened within last N- months (let say 12). Below is my measure:
Card_measure =
Var _cause = MAX( ‘Sheet1’[Cause] )
Var _loc = MAX( ‘Sheet1’[CircuitID] )
Var _equip = MAX( ‘Sheet1’[Equipment] )
Var _zone = MAX(‘Sheet1’[ZoneSubstation])
Var _mindate = EDATE(EOMONTH(TODAY(),0),-[N Value Value])
var _count = CALCULATE(DISTINCTCOUNT(‘Sheet1’[EventID]),FILTER(‘Sheet1’,‘Sheet1’[CircuitID] ==_loc && ‘Sheet1’[Cause] == _cause &&‘Sheet1’[ZoneSubstation] == _zone && ‘Sheet1’[Actual Interruption Start Time (NZST)]>=_mindate))
Return
Sumx(addcolumns(Summarize( ‘Sheet1’, [Cause],[CircuitID],[Equipment],[ZoneSubstation]), “_1”, IF(_count>[Trigger Value Value],_count) ), [_1])
However, the above measure returned blank when I used it in the card visual. I tried to debug the code and found that the _count variable returns null. I am not sure where I am making the mistake. Any help would be really appreciated.
Sample file here
sample_measure.pbix (37.9 KB)