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! Learn more

Reply
mforest
Frequent Visitor

if two values are the same return value of 1

Hello! 

 

Hoping someone can help with the DAX formula I need. I've been searching and trying, but I just cannot seem to get it right. 

 

I unpivoted a table of appointments and now have several hundred "duplicate" appointments. I need to know a count of total appointments that I will use as a measure on several visualizations. Since people can come more than once, distinct count does not work for this case. I essentially am hoping for a measure that says, if "person name" and "date of appointment" are the same, view that as 1 value. For the table value below, I would hope that the measure would return a value of 3. 

 

Person Name

Date of Appointment

Person 1

June 1

Person 1

June 1

Person 1

June 1

Person 2

June 1

Person 2

June 1

Person 1

June 3

Person 1

June 3

 

Thanks!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You can try this one, replacing Table with your actual table name

 

NewMeasure = COUNTROWS(SUMMARIZE(Table, Table[Person Name], Table[Date of Appointment}))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

You can try this one, replacing Table with your actual table name

 

NewMeasure = COUNTROWS(SUMMARIZE(Table, Table[Person Name], Table[Date of Appointment}))

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


This seemed to work! Thanks! I also realized I could concatenate the two columns and then create a measure of distinct values on that column. 

 

Thanks again!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.