Forum Discussion

jibran's avatar
jibran
Helper II
8 years ago
Solved

Count Formula filter by Customer ID

Hi,

I am running into looks like a basic formula problem.

Where I want to caculate total number of vehicles attached to customer against a specific product.

My tables structure is like 

Customer ID         Cusotomer Name                 Registration Number                    Product                           Total

1000020               ABC                                        123 XYZ                                        Breakdown I                   2

1000020               ABC                                        124 ABC                                        Breakdown I                   2

1000021               XYZ                                         356 GHI                                        Breakdown I                   1

1000022               AGH                                        789 DEF                                        Tyre                                2

1000022               AGH                                        111 ABC                                        Tyre                                2

 

I want to see the result as of total column.

 

Many Thanks

  • jibran

     

    Try this

     

    Total =
    CALCULATE (
        COUNT ( TableName[Registration Number] ),
        ALLEXCEPT ( TableName, TableName[Customer Name] )
    )

1 Reply

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    jibran

     

    Try this

     

    Total =
    CALCULATE (
        COUNT ( TableName[Registration Number] ),
        ALLEXCEPT ( TableName, TableName[Customer Name] )
    )