cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pillic
Helper I
Helper I

Measure for Average from below and above Average, Average.

Hello comunity,

 

I was able to summarize the data and calculate the right average based on the summarization.

The measure I created looks like this 

Above/BelowAverage = 

VAR x_AVERAGE =  SUMMARIZE (
      Balken,Balken[STF-Art], 
             Balken[STF-Gehalt],
             Balken[Werk/ Standort], 
      "xx", 
      AVERAGE(Balken[maßg ffcflk, L1]) )

VAR x = AVERAGEX ( x_AVERAGE, [xx] )

Return 
x

This shows me the right values in a table visualisation.

 

Pillic_1-1643393907080.png

 

 

Now I need an additional measure to calculate the average from all values above average and the average from all values below average. (not a conditional formating) 

 

It would be great if someone can point me to the right direction to achieve this.

 

Thanks in advance

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I think you can tweak what you have just a bit.

AboveAvgerage =
VAR x_AVERAGE =
    SUMMARIZE (
        ALLSELECTED ( Balken ),
        Balken[STF-Art],
        Balken[STF-Gehalt],
        Balken[Werk/ Standort],
        "xx", AVERAGE ( Balken[maßg ffcflk, L1] )
    )
VAR x_TotalAVG = AVERAGEX ( x_AVERAGE, [xx] )
VAR x = AVERAGEX ( FILTER ( x_AVERAGE, [xx] >= x_TotalAVG ), [xx] )
RETURN
    x

 

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

I think you can tweak what you have just a bit.

AboveAvgerage =
VAR x_AVERAGE =
    SUMMARIZE (
        ALLSELECTED ( Balken ),
        Balken[STF-Art],
        Balken[STF-Gehalt],
        Balken[Werk/ Standort],
        "xx", AVERAGE ( Balken[maßg ffcflk, L1] )
    )
VAR x_TotalAVG = AVERAGEX ( x_AVERAGE, [xx] )
VAR x = AVERAGEX ( FILTER ( x_AVERAGE, [xx] >= x_TotalAVG ), [xx] )
RETURN
    x

 

Great!!! that shows me the results, perfect!
Thanks Alexis and everyone else who had a look at this.

ValtteriN
Super User
Super User

Hi,

You could use your measure to filter your data and calculate average from there. E.g.

data:

ValtteriN_0-1643395984816.png

Example:

Average of below average = CALCULATE(AVERAGE('Below/over average'[Value]),FILTER('Below/over average','Below/over average'[Value]<CALCULATE([Average example],ALL('Below/over average'))))
End result:
ValtteriN_1-1643396021821.png



I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/









Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello ValtteriN,

 

thanks for the hint, but it doesnt gives me the expected result or i have a typo:

 

Average of above average = 

  CALCULATE(AVERAGE(Balken[maßg ffcflk, L1]),FILTER(Balken,Balken[maßg ffcflk, L1] < CALCULATE(InterpolationDF28[Above/BelowAverage],ALL(Balken))))

 

The average measure shows me the average from the filtered values in the blue frame. Compared to this is green above and red are the below values. I need a way to calculate the average from green and also from red.

 

Pillic_0-1643399642633.png

 

 

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.