Forum Discussion

PiyushBQ's avatar
PiyushBQ
Helper I
6 years ago
Solved

Average After Slicer Input

Hi,

I have this dataset

SectorItemValueAverage (calculate)Rank (calculate)
GoldE8966.61
GoldC8266.62
GoldD6966.63
GoldB5166.64
GoldA4266.65
SilverF1995515043.21
SilverH1648715043.22
SilverG1492715043.23
SilverJ1210315043.24
SilverI1174415043.25

 

The way this works is, the user selects "Silver" or "Gold" from the slicer and the items get ranked dynamically. Also, the average for that particular product category, gold or silver, should reflect in a different column.

 



I was able to calculate the rank but need guidance on calculating the average.

 

How do I calculate the average? 

Thank you!
Piyush

  • Hi PiyushBQ ,

     

    Try create measure like this:

    Measure = CALCULATE(AVERAGE('Table'[Value]),ALLSELECTED('Table'))

    Or calculated column:

    Column = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[Sector]))

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • PiyushBQ wrap SUM in CALCULATE

    Avg  = AVERAGEX ( Table, CALCULATE ( SUM ( Table[Column] ) ) )

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

    • PiyushBQ's avatar
      PiyushBQ
      Helper I

      Thank you for taking the time out parry2k .

      I tried doing it but it didn't work. Please check the screenshot.