Forum Discussion

faustusxanthis's avatar
faustusxanthis
Frequent Visitor
1 year ago
Solved

Need help summarizing row count

Hello! It seems I'm out of options and I can't seem to find the right solution.  My data is like this:  Date Person Count Instance 1/1/2024 Person 1 2 1/1/2024 Person 1 2 1/1/2...
  • Ashish_Mathur's avatar
    1 year ago

    Hi,

    This calculated column formula works

    Column = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Date]=EARLIER(Data[Date])&&Data[Person]=EARLIER(Data[Person])))

    Hope this helps.

     

  • lbendlin's avatar
    lbendlin
    1 year ago

    Here is a better version

     

    Count Instance =
    CALCULATE (
        COUNTROWS ( Data ),
        TREATAS ( { ( [Date], [Person] ) }, Data[Date], Data[Person] )
    )
     
    Not using EARLIER (which is discouraged anyway) or variables.