Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

ID average by month

Hello guys, I have two columns. One for ID and one for Month.  I use letters for each ID. I want to count how many times an ID appears. I get this result with a COUNTA. I block in the next step. I would like to have the average appearance for each ID per month. Thank you

 

 

3 Replies

  • Anonymous , Try a measure like

    averageX(values(Table[ID]), calculate(countA(Table[ID])))

    or

    averageX(values(Table[Monthyear]), calculate(countA(Table[ID])))

     

    Create a column

    month year = format([date],"YYYYMM")

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    I think you may want to calculate the average of the count of each ID by month.

    I build a sample table to have a test.

    Your month may be the first day of each month, and the table is as below.

    Measure:

    Avg Per Month = averageX(FILTER(ALLEXCEPT('Table','Table'[Month]),'Table'[ID]=MAX('Table'[ID])),CALCULATE(COUNT('Table'[ID])))

    Result is as below. 

    Ex: Avg of count A = Count of A / count of Month = (1+2)/(2)=1.5

     

    You can download the pbix file from this link: ID average by month

     

    Best Regards,

    Rico Zhou

     

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

     

    Best Regards,

    Rico Zhou