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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

distinct count with filter

Good Morning,

I need some help please with a distinct count with a filter.

The count is for customer, i need to filter on two dates so it is only counting where the first date is greater than the second date.

For example in the below table i would get a result of 3:

CustomerDate 1Date 2
126/01/202028/02/2022
128/12/202125/11/2021
231/02/202231/01/2022
301/06/202131/05/2021
305/08/202007/04/2022
5 REPLIES 5
Anonymous
Not applicable

Hi the tables are joined by the customer number

How? Can you show a picture?

 

How does Table 1 know, which Date 2 belongs to which Date 1?

Anonymous
Not applicable

Thank you, i forgot to say that the two dates are from two different tables. 

And how are those tables connected?!

lukiz84
Memorable Member
Memorable Member

Hi,

 

CustomerCount =
   CALCULATE(
      DISTINCTCOUNT(table[Customer]),
      FILTER(
         table,
         table[Date 1] > table[Date 2]
      )
   )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.