Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Median function on a MAX column

Hello,   I am trying to calculate the median on a max column (Max_DelaiH). I had to create a max column because I have duplicates.  I tried  Tmps_Median = VAR __table4 = SUMMARIZE('Documen...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    Please add function CALCULATE() out side the MEDIAN function or MEDIANX(). Like the following expression.

     

    Tmps_Median = 
    VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
    RETURN
    IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],
    CALCULATE(MEDIAN([__value4]), '__table4')
    )
     
    OR
     
    Tmps_Median = 
    VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
    RETURN
    IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],
    MEDIANX(__table4,[__value4])
    )
     

    Best Regards

    Community Support Team _ chenwu zhu

     

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