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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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