Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

What would be the exact formula for this count function?

Hi,

 

I want to come up with a formula which aggregrates the number of creation times per person based on one day. 

 

 

 

The column index is just 1. The second image shows that the index variable has been summed up based on time and user. So, for 8/1/2018, Mr B has 5 different creation times. What DAX formula would you use to manually create the summed up values of the index without having to rely on summarization option in visualizations? We need to manually create this column since we want to be able to categorize users according to their summed up index numbers. I am guessing the formula would involve either the COUNT function or the SUMX function. 

 

P.S: We've found a way of creating a measure to do this but we need something of a permanent nature, specifically a formula for a column so that we can automate the whole process at the end of the day.

 

Thank you!

 

Best regards,

vvmob

 

  • Anonymous 
     
    create a calcualted column
    countfunction = CALCULATE(SUM(Table1[Index]), ALLEXCEPT(Table1, Table1[User Name], Table1[CreationTimeUTC.1]))

5 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion
    Anonymous  please provide the data in text format not an image
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi vanessafvg,

       

      Sure, here it is.

       

      CreationTimeUTC.1User NameIndex
      8/1/2018 0:00B1
      8/1/2018 0:00B1
      8/1/2018 0:00B1
      8/1/2018 0:00B1
      8/1/2018 0:00B1
      11/26/2018 0:00D1
      11/26/2018 0:00D1
      11/26/2018 0:00D1
      1/16/2019 0:00D1
      1/16/2019 0:00D1
      3/20/2019 0:00D1
      • vanessafvg's avatar
        vanessafvg
        Icon for Community Champion rankCommunity Champion
        Anonymous 
         
        create a calcualted column
        countfunction = CALCULATE(SUM(Table1[Index]), ALLEXCEPT(Table1, Table1[User Name], Table1[CreationTimeUTC.1]))
  • richbenmintz's avatar
    richbenmintz
    Icon for Resident Rockstar rankResident Rockstar

    Hi Anonymous 

    I believe you are trying to create a summary table, try the following.

    click in the model tab-> create table -> enter formula (please note table names will be different in your model)

     

    Table = SUMMARIZE('Table1', Table1[User Name], Table1[CreationTimeUTC.1], "index count", sum(Table1[Index]))

    Hope that helps