Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create sum and average slicer

Hi everyone, i would like to create a slicer including 2 options sum and average like this so that when i need to see the group by of my data by sum or average. For example in a week the data is 7 wi...
  • ReneMoawad's avatar
    3 years ago

    Hi,

     

    I believe you already created the table Aggregation including 2 rows (Sum and Avg)

     

    Now you need to create a new Measure like the below:

     

    Aggregation Measure =

    Var selectedAgg = SELECTEDVALUE(AggregationTable[Aggregation]) 
    Return

    IF(

        selectedAgg = "Sum"

        , SUM(Table[Amount])

        , AVERAGE(Table[Amount])

    )