Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

New column with count conditional for customer ID

Hi, I have a table with columns Customer_ID Store_Brand Order count Date The Store_Brand has different store brands I want to have a column that counts for each Customer_ID row the distinct ...
  • v-jianboli-msft's avatar
    v-jianboli-msft
    3 years ago

    Hi Anonymous ,

     

    Please try:

    Distinct_Store_Brand_Count = CALCULATE(DISTINCTCOUNT('Table'[Store_Brand]),FILTER('Table',[Customer_ID]=EARLIER('Table'[Customer_ID])))

    Final output:

    Best Regards,

    Jianbo Li

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