Forum Discussion

jonasr's avatar
jonasr
Icon for Advocate I rankAdvocate I
9 years ago
Solved

Aggregates of counts over time

Hi,   I am trying to do some dynamic aggregation over dynamically calculated measure and I am not sure if such a thing is even possible.   Basically, I have data with something similar to the fol...
  • OwenAuger's avatar
    9 years ago

    Hi jonasr

     

    This may have been covered in Greg_Deckler's reply.

     

    The general pattern I would use for averaging a measure over the values in a particular column is:

     

    Measure averaged by Granularity column =
    AVERAGEX ( VALUES ( <Granularity column> ), [Measure] )

    Using your sample table, <Granularity column> is table[snapshot date], so this measure would do what you want:

    Share averaged by snapshot date =
    AVERAGEX ( VALUES ( table[snapshot_date] ), [Share] )

    I tested it out and I got 0.625 when group="A" and 0.5 when group = "B".

     

    I would avoid creating a calculated table in this case.

     

    Regards,

    Owen