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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.