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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
aflintdepm
Helper III
Helper III

Counting blank results from a measure

I have a set of data for customer appointments

 

Table 1 is the customer fact table (name, id, etc.)

Table 2 is the appointment data (id, appointment date, appointment status)

 

I have a measure that calculates the next future appointment

Measure =

CALCULATE(
    MIN('Appointments'[Appointment Date]),
    'Appointments'[Appointment Date]>=TODAY())
 
What I need is a way to count how many of the customers have no next appointment.  I can see who doesn't by using a table and making my measure one of the columns, but I need to count how many rows are blank for this value.
 
Thanks for any help.
1 ACCEPTED SOLUTION
vicky_
Super User
Super User

I'm going to assume that the id column links the two tables, but go ahead and substitute whatever you need.

Customers with no Next Appointment = 
var AllCustomers = VALUES(Table1[CustomerID])
var customersWithAppointment = SELECTCOLUMNS(FILTER(Table2, Table2[Appointment Date] >= TODAY()), 
    "customers", Table2[id])

RETURN COUNTROWS(EXCEPT(AllCustomers, customersWithAppointment))

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

I'm going to assume that the id column links the two tables, but go ahead and substitute whatever you need.

Customers with no Next Appointment = 
var AllCustomers = VALUES(Table1[CustomerID])
var customersWithAppointment = SELECTCOLUMNS(FILTER(Table2, Table2[Appointment Date] >= TODAY()), 
    "customers", Table2[id])

RETURN COUNTROWS(EXCEPT(AllCustomers, customersWithAppointment))

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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