Forum Discussion
Anonymous
2 years agoNot applicable
DAX calculation
I have below excel wherei need to calculated total count and result. if 2 or more record breach then it will be failed. and if time crosses 99 (only in True case) then it will be failed.
| Priority | Ticket no | SLA breach | Duration in sec |
| P1 | 1234 | TRUE | 100 |
| P1 | 6854 | FALSE | 2 |
| P3 | 6754 | FALSE | 3 |
| P2 | 2453 | TRUE | 56 |
| P2 | 8669 | TRUE | 78 |
| P3 | 7585 | TRUE | 64 |
So, expected below output
| Priority | Total Ticket | Result |
| P1 | 3 | Fail |
| P2 | 2 | Fail |
| P3 | 2 | Pass |
Any help would be appreciated
Anonymous
pls try this
Measure =VAR _count=CALCULATE(COUNTROWS('Table'),'Table'[SLA breach]=true())VAR _time=sumx(FILTER('Table','Table'[SLA breach]=true()),'Table'[Duration in sec])return if(_count>=2 ||_time>99,FALSE(),TRUE())one more question , why the ticket no for P1 is 3?pls see the attachment below
5 Replies
- ryan_mayuSuper User
what do you mean by 2 or more record breach?
- AnonymousNot applicable
It means 2 or more ticket breached ( SLA breach will be True) for a single type. for above example its P2, where breach count is 2 as both are True
- ryan_mayuSuper User
Anonymous
pls try this
Measure =VAR _count=CALCULATE(COUNTROWS('Table'),'Table'[SLA breach]=true())VAR _time=sumx(FILTER('Table','Table'[SLA breach]=true()),'Table'[Duration in sec])return if(_count>=2 ||_time>99,FALSE(),TRUE())one more question , why the ticket no for P1 is 3?pls see the attachment below