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
sherwood
Helper I
Helper I

Percentage of appointments based on LASTDATE

I'm trying to calculate the percentage of customers who have made an appointment, against the total number of customers. 
Unfortunately, as customers can make multiple appointments, the current total number of appointments exceeds the total number of customers. 

TOTAL Customer nameTOTAL Appointment Date
74103



Is there a calculation I can do to create a measure based on a COUNT of LASTDATE without including the duplicate entries?
I've attached sample data below.

Table1Table2Table2
Customer nameAppointment DateLast Appointment Date
A27/10/202229/10/2022
A28/10/202229/10/2022
A29/10/202229/10/2022
B30/10/202231/10/2022
B31/10/202231/10/2022
C01/11/202203/11/2022
C02/11/202203/11/2022
C03/11/202203/11/2022
D04/11/202204/11/2022
E05/11/202205/11/2022
F06/11/202206/11/2022
G07/11/202207/11/2022
H08/11/202208/11/2022
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can do something like

Customers with appointments = COUNTROWS(VALUES('Appointments'[Customer]))

View solution in original post

10 REPLIES 10
tamerj1
Super User
Super User

Hi @sherwood 

How are you planning to disply the result? In card visual? Can you present an example?

Hi,

 

I'd like to add a column that indicates if a Customer has made and Appointment, then show the Total as a percentage in a visual. 

@sherwood 

Add a column to what? To show the percentage in which type of visual? Can provide the screenshot? The Last Appointment Date is Column or a measure?

Sorry, I was confusing two possible solutions. 

I need to get the total count of all Customers who have made an Appointment. I want to add the percentage to a table or card.

@sherwood 

The solution provided by @johnt75 shall provide the correct results 

johnt75
Super User
Super User

You can do something like

Customers with appointments = COUNTROWS(VALUES('Appointments'[Customer]))

Apologies, it took some customising but this was the solution. Thank you for your help. 

Hi, 

 

This seems to be counting all rows with appointment values, rather than accounting for last appointment date only. 

eliasayy
Impactful Individual
Impactful Individual

Hello please try:

Calculate(distinctcount([customer name]),filter(table,[last date] = max([last date]))

Hi,

 

This is counting rows where there is no appointment date.

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.