Forum Discussion
Ana_Cardoso
6 years agoFrequent Visitor
Idenfity peak
Hello all, I have a dataset with Timestamp, TagName and KPIValue of multiple tags. And I need to count "alarms" that is when I had a peak on a curve by TagName. My alarm trigger is KPIValue >= 50. ...
- 6 years ago
Hi, Ana_Cardoso
Based on your description, you may create two measures as below.
Alarm =var _currentvalue = SELECTEDVALUE('Table'[Value])var _currentdatetime = SELECTEDVALUE('Table'[Data Hora])var _currenttag = SELECTEDVALUE('Table'[Tag])var _lastvalue =CALCULATE(MAX('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Tag] = _currenttag&&'Table'[Data Hora] =CALCULATE(MAX('Table'[Data Hora]),FILTER(ALLSELECTED('Table'),'Table'[Tag] = _currenttag&&'Table'[Data Hora]<_currentdatetime))))returnSUMX('Table',IF(ISFILTERED('Table'[Data Hora]),IF(_lastvalue<50&&_currentvalue>50,1,0)))Count =SUMX('Table',[Alarm])Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
6 years agoSuper User
Hi,
If you wish to count the number of instances when the figures available in the Value column exceed 50, then write this measure
=CALCULATE(COUNTROWS(Data),Data[Value]>50)
Hope this helps.