Forum Discussion

SteveIOW's avatar
SteveIOW
Icon for Helper II rankHelper II
4 years ago

Average of DistinctCount PCM

Dear all,

 

as you can see below I am trying to find the average of the last 6 months data.

The data is loaded in as individual users and the date the access a website. I am countinf the number that acess the site per month.

Distinct Users = DISTINCTCOUNT(UserID)

Then I am plotting this against a date from a Calendar table.

Now I want an average line.

I am using

AvUsersPCM = CALCULATE(AVERAGEX(SUMMARIZE('Calendar','Calendar'[YearMonthShort]), MeasuresTable[DistinctUsers]), ALLSELECTED('Calendar'[YearMonthShort]),'Calendar'[Last6Months] = "Y")
 
But it is way too low... the Last6Months flag gives the months to the right of the chart.

 

Can anyone help please?

 

4 Replies

  • Average Per Country = 
    VAR _A =
        SUMMARIZE (
            'Table',
            'Table'[Country],
            'Table'[Product],
            "DisC", DISTINCTCOUNT ( 'Table'[Color] )
        )
    RETURN
        AVERAGEX ( _A, [DisC] )
    // Modify it with your scenario
    • SteveIOW's avatar
      SteveIOW
      Icon for Helper II rankHelper II

       

      mh2587 Forgive me but is this not exactly the same as I ahve put above but without the ALLSELECTED?