Forum Discussion

pmonte's avatar
pmonte
Frequent Visitor
2 years ago
Solved

Calculate average from a table with snapshots

I have a source table contains rows representing portfolio snapshots on specific dates, with columns: date, owner, category and number of items. I need to create a table showing the owner and its av...
  • govindarajan_d's avatar
    govindarajan_d
    2 years ago

    Hi pmonte,

     

    I do not know the exact columns you are using, but please modify the below according to your requirements:

     

    ItemMeasure =
    VAR __Average = AVERAGEX(VALUES(Table[Portfolio]), [NumberOfItems])
    VAR __Sum = SUM([NumberOfItems])
    RETURN IF(INSCOPE(Table[GeographyLevel3]),__Average,__Sum)

     

    Using INSCOPE we will be able to know at which level the current measure is being applied on and try to change the measure value accordingly