Forum Discussion
ReutAtias12
3 years agoFrequent Visitor
count with condition
Hi All, this is my data sample: Account id attackid attack date module assessName status 1 01 1/1/22 aa xx failed 1 02 2/1/22 aa yy failed 1 03 2/1/22 cc xx failed...
- 3 years ago
Hi, ReutAtias12
Of course.
Measure:
Measure 1 = CALCULATE ( COUNT ( 'Table'[Account id] ), FILTER (ALL('Table'), [assessName] = SELECTEDVALUE( 'Table'[assessName] ) && [module] = SELECTEDVALUE( 'Table'[module] ) && [status] = "failed" && [attackid] <= SELECTEDVALUE ( 'Table'[attackid] ) ) )Measure 2 = VAR _Previous = MAXX ( FILTER ( ALL('Table'), [attackid] < SELECTEDVALUE( 'Table'[attackid] ) && [module] = SELECTEDVALUE('Table'[module] ) && [assessName] = SELECTEDVALUE( 'Table'[assessName] ) ), [attackid] ) RETURN IF ( [Measure 1] = 2, _Previous, BLANK () )Measure 3 = IF(SUM('Table'[attackid])-[Measure 2]=1&&[Measure 2]<>BLANK(),1,BLANK())Count = CALCULATE(COUNT('Table'[Account id]),FILTER(ALL('Table'),[Measure 3]=1))Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
daXtreme
Solution Sage
3 years agoThe description is not clear. If you want a good solution, you have to provide a good and comprehensible description of the problem.
- ReutAtias123 years agoFrequent Visitor
i change the explanation, hope it's more clear