Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Average of users

 I want to make average of users per month. Count of users are distinct each month. But I want my average should look like: for the first two months (173+308)/2 or for three months (173+308+382...
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    8 years ago

    Anonymous

     

    What about this one? :smileytongue:

     

    Average User Count by month =
    IF (
        HASONEVALUE ( 'Talend_GA sessions'[Month] ),
        AVERAGEX (
            FILTER (
                ALLSELECTED ( 'Talend_GA sessions'[Month] ),
                'Talend_GA sessions'[Month] <= SELECTEDVALUE ( 'Talend_GA sessions'[Month] )
            ),
            CALCULATE ( DISTINCTCOUNT ( 'public accounts_usersession'[user_id] ) )
        ),
        DIVIDE (
            AVERAGEX (
                ALL ( 'Talend_GA sessions'[Month] ),
                CALCULATE ( DISTINCTCOUNT ( 'public accounts_usersession'[user_id] ) )
            ),
            DISTINCTCOUNT ( 'Talend_GA sessions'[Month] )
        )
    )