Forum Discussion

mandeeps19's avatar
mandeeps19
New Member
3 years ago

Need Help in calculating distinct count using multiple conditions

Hi,

 

Need help in calculating distinct count of App where tickets status is approved but those should include only tickets where you have one Approved status.

 

so for example  if app A is have both approved status and inflight status it should not count but only count if it is Approved status

 

Approved statuses  - 

Approved


Approved With Exceptions
Conditionally Approved

 

and rest all in flight status

 

 

 

APPTicketStatus
AT-0001Discarded
AT-0002New Request
AT-0003Pending DA Review
BT-0004Rejected
BT-0005Approved
BT-0006Approved With Exceptions
BT-0007Conditionally Approved
CT-0008Pending E Review
DT-0009Pending Findings - D/APP TEAM
DT-0010A Scheduled
ET-0011Pending Findings – E
ET-0012C Scheduled
ET-0013E SCHEDULED
ET-0014Discarded
ET-0015New Request
ET-0016Pending DA Review
FT-0017Rejected
FT-0018Approved
FT-0019Approved With Exceptions
FT-0020Conditionally Approved
GT-0021Pending EA Review
GT-0022Pending Findings - D/APP TEAM
GT-0023A Scheduled
GT-0024Pending Findings – E
GT-0025C Scheduled
GT-0026E SCHEDULED
GT-0027Approved

amitchandak 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mandeeps19 ,

     

    I suggest you to try code as below to create a measure. I think the result should be 0.

    Distinct Count APP only in Approved Status =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[APP] ) )
        - CALCULATE (
            DISTINCTCOUNT ( 'Table'[APP] ),
            FILTER (
                'Table',
                NOT ( 'Table'[Status] IN { "Approved With Exceptions", "Conditionally Approved" } )
            )
        )

    Result is as below.

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • mandeeps19's avatar
      mandeeps19
      New Member

      The result should be 4 as you can see A,C,D & E doesnt have the approved status