Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mandeeps19
New Member

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 2
v-rzhou-msft
Community Support
Community Support

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.

vrzhoumsft_0-1683184136357.png

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.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.