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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.