Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Get Median values for specific time range after aggregation

Hello everyone, I am struggling to get a MEDIAN value for a specific time limit (just only for the first 3 or 4 months). The data set is daily data but I would like to compute the Median value afte...
  • v-zhangti's avatar
    v-zhangti
    3 years ago

    Hi, Anonymous 

     

    You can try the following methods.

    Measure:

    4month = 
    Var _table=SUMMARIZE('Table','Table'[Year],'Table'[Month],"Sum",[Total View])
    Return
    MEDIANX(_table,[Sum])

    3month = 
    Var _table=SUMMARIZE('Table','Table'[Year],'Table'[Month],"Sum",[Total View])
    Return
    MEDIANX(FILTER(_table,[Month]>=9&&[Month]<=11),[Sum])

    2month = 
    Var _table=SUMMARIZE('Table','Table'[Year],'Table'[Month],"Sum",[Total View])
    Return
    MEDIANX(FILTER(_table,[Month]>=9&&[Month]<=10),[Sum])

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

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