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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Sir_night
Frequent Visitor

Count duplicate ID

Hi

Need to be a able to count the number of customer orders  and be able to filter by order date wich updates the count of customer orders. 

 

Customer IDOrder IDOrder DateNo Customer Orders
111/01/20172
123/01/20172
232/01/20171
345/01/20174
358/01/20174
369/01/20174
3710/01/20174

 

 

With Date filter 08/01/2017 to 10/01/2017

 

Customer IDOrder IDOrder DateNo Customer Orders
358/01/20173
369/01/20173
3710/01/20173

  

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Sir_night wrote:

Hi

Need to be a able to count the number of customer orders  and be able to filter by order date wich updates the count of customer orders. 

 

Customer ID Order ID Order Date No Customer Orders
1 1 1/01/2017 2
1 2 3/01/2017 2
2 3 2/01/2017 1
3 4 5/01/2017 4
3 5 8/01/2017 4
3 6 9/01/2017 4
3 7 10/01/2017 4

 

 

With Date filter 08/01/2017 to 10/01/2017

 

Customer ID Order ID Order Date No Customer Orders
3 5 8/01/2017 3
3 6 9/01/2017 3
3 7 10/01/2017 3

  


@Sir_night

You can try a measure as below.

No Customer Orders =
COUNTAX (
    FILTER (
        ALLSELECTED ( Table1 ),
        Table1[Customer ID] = MAX ( Table1[Customer ID] )
    ),
    Table1[Order ID]
)

Capture.PNGCapture.PNG

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Sir_night wrote:

Hi

Need to be a able to count the number of customer orders  and be able to filter by order date wich updates the count of customer orders. 

 

Customer ID Order ID Order Date No Customer Orders
1 1 1/01/2017 2
1 2 3/01/2017 2
2 3 2/01/2017 1
3 4 5/01/2017 4
3 5 8/01/2017 4
3 6 9/01/2017 4
3 7 10/01/2017 4

 

 

With Date filter 08/01/2017 to 10/01/2017

 

Customer ID Order ID Order Date No Customer Orders
3 5 8/01/2017 3
3 6 9/01/2017 3
3 7 10/01/2017 3

  


@Sir_night

You can try a measure as below.

No Customer Orders =
COUNTAX (
    FILTER (
        ALLSELECTED ( Table1 ),
        Table1[Customer ID] = MAX ( Table1[Customer ID] )
    ),
    Table1[Order ID]
)

Capture.PNGCapture.PNG

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.