Forum Discussion

ThisIsMe's avatar
ThisIsMe
New Member
6 years ago
Solved

Calculated Column - Distinct Count By Another Column and Filter

Hello,   I have a table with 3 columns, Customer Number, Account Number & Flag. I want to create a calculated column(NOT A MEASURE) which counts the number of accounts per customer when the flag is...
  • Ashish_Mathur's avatar
    6 years ago

    Hi,

    This calculated column formula works

    =CALCULATE(COUNTROWS(Data),FILTER(Data,Data[CustomerNumber]=EARLIER(Data[CustomerNumber])&&Data[Flag]="Y"))

    Hope this helps.