How Calculate Median in Hours Spent


I am triying to calculate the Median of an Hour Spent, but i can’t reach it.

I have a report which has 3 Dimensions, Provincia (Example: Logroño), Tipo (Incidente) and Categoria interna. Then i have the Horas Imputadas (Hours Spent) by Categoria Interna, and a Custom Measure Promedio de Horas Imnputadas that is the Average gruped by Categoria Interna.

I need the same measure as the Average but with the Median.

how can i get it?

I used this formula but i only get the Median grouped by Tipo:


[Categoría interna].[Categoría interna].Members,

[Measures].[Horas Imputadas]


Thanks in advance!