Forum Discussion

sublog's avatar
sublog
Helper III
7 years ago
Solved

MedianX Help

Trying to calculate a median transaction cycle time, but I want to exclude certain ordertypes. The formula I've come up with does not produce the correct #. 

 

Median TCT = MEDIANX( FILTER(WO,[OrderType]="Repair"),WO[TCT]) This = 66 days and when I do it on the same data in Excel I get 45. 
 
Defintely very new with DAX so any help in the right direction would be appreciated! 
  • HI, sublog 

    I have test on my side, it works well,  if you could try this:

    Measure 2 = CALCULATE(MEDIAN(WO[TCT]),FILTER(WO,[OrderType]="Repair"))

    If still have the problem, there may be something wrong in others,  And please share your sample data and expected output.

     

    Best Regards,

    Lin

2 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    HI, sublog 

    I have test on my side, it works well,  if you could try this:

    Measure 2 = CALCULATE(MEDIAN(WO[TCT]),FILTER(WO,[OrderType]="Repair"))

    If still have the problem, there may be something wrong in others,  And please share your sample data and expected output.

     

    Best Regards,

    Lin

    • sublog's avatar
      sublog
      Helper III

      Hi I tried this formula. It's working!