Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Median value not same as Excel

  I am pretty new to power bi.   So I am trying to calculate median and have been getting difference in values when I calculate edian using excel and when I use power bi to do the same.   An exa...
  • dax's avatar
    6 years ago

    Hi Anonymous , 

    I test this in my emviornment, I  get result like below

    Measure = CALCULATE(MEDIAN('Table'[marks]))

    The results are the same, and you could refer to https://www.mathsisfun.com/median.html  for logic.

    Best Regards,
    Zoe Zhi

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

  • dax's avatar
    dax
    6 years ago

    Hi Anonymous , 

    I have shown DAX in above post , you could refer to it, and below is expression to calculate median in excel

    If you have other fields, you also could add it in below expression

     CALCULATE(MEDIAN('Table'[marks]), ALLEXCEPT('Table','Table'[Class]))

    Best Regards,
    Zoe Zhi

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