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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

how to get the median without using table measure

Hi expert,

here is the data looks like:

id value

1     3

2     10

1      2

3       6

...

so  there are multiple rows to a certain id,

how can I get the median value and the median id without creating a new table such as using smmzrize?

thank you.

 

4 REPLIES 4
suparnababu8
Super User
Super User

Hi @Anonymous 

You can set median for any value with out using Dax measure by using default options in Power BI. Can you expand the median of below image.

suparnababu8_0-1725508437528.png

and

 

suparnababu8_1-1725508481837.png

Now here you can add your two colums in add line option.

Thanks!

Anonymous
Not applicable

Hi @Anonymous 

 

Agree with Idrissshatila. Using the MEDIAN function is a straightforward way to find the median value.

Allow me to add the method of calculating the median ID here, I hope it helps.

MedianID = 
VAR TotalRows = COUNTROWS(ALL(yourtable))
VAR MidRow = INT((TotalRows + 1) / 2)
RETURN
MAXX(
    TOPN(
        MidRow,
        ALL(yourtable),
        yourtable[value], ASC,
        yourtable[id], ASC
    ),
    yourtable[id]
)

It should be added that this result is accurate when you have an odd number of data rows, and when you have an even number of rows it returns the ID of the first of the two rows where the median is found.

 

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

Uzi2019
Super User
Super User

Hi @Anonymous 

please share the sample data and expected output as well. it will help us to understand the requirement more easily.. 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Idrissshatila
Super User
Super User

Hello @Anonymous ,

 

you create a measure as the following

Median = MEDIAN(<column>)

https://learn.microsoft.com/en-us/dax/median-function-dax

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors