Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tempo
New Member

Average over median values, which gets data from a measure

So I have a complex measures wich calculates the values, which you can see in the table. This specific measures uses other measures to calculate these values.

YearEnterprise_1Enterprise_2
2020-0.17 
2021-0.39-0.3
2022-0.57-0.6

Now what I want to do, is to calculate the median of this value per enterprise and then calculate the average of this median values. So the calculation would look something like this:

Median Enterprise_1: MEDIAN(-0.17,-0.39,-0.57) = -0.39
Median Enterprise_2: MEDIAN(-0.3,-0.6) = -0.45

Average over both enterprises: AVERAGE( -0.39, -0.45) = -0.41667

That is the result, which I need.

Attempt

My first try was to use the GROUPBY-Function, but I always got the error:
"Function 'GROUPBY' scalar expressions have to be Aggregation functions over CurrentGroup(). The expression of each Aggregation has to be either a constant or directly reference the columns in CurrentGroup()." I think the problem there was, that I have several measures which are needed for the basic values (values in the table). I did use MEDIANX()-Function.

I also tried to add all the measure to a separate table. I added the calculated MedianColumn like:
MEDIANColumn = MEDIAN([Revenue Delta Median])

Then I tried to add a measure to calculate the average over that:

AverageMeasure =CALCULATE(AVERAGE('Table'[MEDIANColumn]),FILTER('Table','Table'[MEDIANColumn]<>BLANK()))

The Result which I get is always blank.

Does somebody can help me, how to solve that (number of enterprises is dynamically)?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Tempo ,

 

You could create measures like:

Median Enterprise_1 = CALCULATE(MEDIAN('Table'[Enterprise_1]),ALLSELECTED('Table'))
Median Enterprise_2 = CALCULATE(MEDIAN('Table'[Enterprise_2]),ALLSELECTED('Table'))

vstephenmsft_0-1662024829030.png

 

Then get the average

Average over both enterprises = DIVIDE([Median Enterprise_1]+[Median Enterprise_2],2)

vstephenmsft_1-1662024939911.png

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Tempo ,

 

You could create measures like:

Median Enterprise_1 = CALCULATE(MEDIAN('Table'[Enterprise_1]),ALLSELECTED('Table'))
Median Enterprise_2 = CALCULATE(MEDIAN('Table'[Enterprise_2]),ALLSELECTED('Table'))

vstephenmsft_0-1662024829030.png

 

Then get the average

Average over both enterprises = DIVIDE([Median Enterprise_1]+[Median Enterprise_2],2)

vstephenmsft_1-1662024939911.png

 

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.