Forum Discussion

DaanBos's avatar
DaanBos
Frequent Visitor
3 years ago

How to count duplucates in DAX?

Dear Users,

 

I want to count every consigment for each customer.

 

I tried the following DAX Code:

 

Count_consignments_per_Customer = CALCULATE(COUNT(CONSIGNMENT[CONSIGNMENT_NR]), ALLEXCEPT(CUSTOMER,CUSTOMER[CUSTOMERNO]))
 
But it returns the value 1 everytime.
 
Pls help

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi DaanBos 
    Please try

    Count_consignments_per_Customer =
    CALCULATE (
        COUNT ( CONSIGNMENT[CONSIGNMENT_NR] ),
        ALLEXCEPT ( CONSIGNMENT, CUSTOMER[CUSTOMERNO] )
    )
  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, DaanBos 

     

    Can you provide more sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.