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
CJ_96601
Helper V
Helper V

calculate the median from an exising measure

Good morning, 

 

i have an existing measure, called "Leavers" and i would like to calculate the average tenure ( field name from the same table is (YOS).

 

Avg Tenure = 

([Leavers]),

calculate(median('table name'([YOS])+0))

 

Can someone help me to fix above dax.

 

Thanks

 

 

Thanks

5 REPLIES 5
Anonymous
Not applicable

Hi @CJ_96601 ,

 

Can you let me know if your problem has been resolved? If yes, please share your solution in order to help more people with the same problem, if not share your sample input data (please be careful to protect private data) and expected output results.

 

The MEDIAN function only supports columns and not measures. If you want to get the median of a YOS column, then you can create the following measure:

Median = Median('table name'([YOS]))


If you want to get the mean of that YOS column, you can use the AVERAGE() function.

AVERAGE - DAX Guide

 

Best Regards,

Neeko Tang

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

Ashish_Mathur
Super User
Super User

Hi,

We may be able to do this with an AVERAGEX().  To receive further help, share some data, explain the question and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

Thanks

 

Ritaf1983
Super User
Super User

Hi @CJ_96601 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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