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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Creating a measure to count "Appointments" (date), avoiding duplicates in two columns

Hello folks,   I've gotten some great advice, help, and tips from you in the past and I was hoping you could help again.  

I have a dataset where I need to count distinct "appointments".  The problem is, sometimes those appointments are  sometimes on two people's calendars at the same time, and only count as one visit.  

What I'm looking for is a way to say: if there is more than one appointment on a calendar day with the same subject ID (unique value), only count ones assigned to a particular group (already configured the groups).  

I started creating a measure, but I didn't get far.  

I know it will probably be some combination of COUNT and FILTER, but I'm struggling to find the right one.  

Let me know if I can clarify anything.


 

Thank you for taking the time!

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous , 

 

Please try this code:

COUNT MEASURE = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Appointments] ),
    FILTER ( ALLSELECTED ( 'Table' ), [group] = SELECTEDVALUE ( 'Table'[group] ) )
)

 

If you need more help, please provide some example data and expect result.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous , 

 

Please try this code:

COUNT MEASURE = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Appointments] ),
    FILTER ( ALLSELECTED ( 'Table' ), [group] = SELECTEDVALUE ( 'Table'[group] ) )
)

 

If you need more help, please provide some example data and expect result.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

SpartaBI
Community Champion
Community Champion

@Anonymous can you share a sample data and write here what ia the desired result

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors