Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

CUSTOM PERCENTILE FAIL

Hi everyone.

 

I have a table that contains one record per year, I need to calculate the percentile for each of them, referencing another table that has the records to apply but when I do it it does not give the exact value, when I calculate it in excel or another medium always comes out the same minus here. The formula is the following.

 

GCuartilMediana =

var YearEval = MAX(Calendario[YearEval])
var MyTabla = CALCULATETABLE (
Evaluacion
; FILTER ( ALLEXCEPT ( Evaluacion
; Evaluacion[Empresa]
; Evaluacion[Area]
; Evaluacion[UO]
; Evaluacion[NivelEquivalente]
)
; Evaluacion[YearEval] = YearEval
&& ISBLANK(Evaluacion[GLO_Media]) = FALSE()
)
)

RETURN
PERCENTILEX.EXC(MyTabla; [GLO_Media]; [CuartilMediana]) + 0

 

Can you help me?. Thanks a lot.

 

[CuartilMediana] = 0.5

Final Result = 109.61

True Result = 109.47

 

 

Status: New
Comments
v-lili6-msft
Community Support

hi  @omiranda 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

omiranda
Regular Visitor

Hi.

 

The problem is with DirectQuery with SQL. The import mode is good. 

The problem is that it is a table filtered only by the last three years since the last one selected.

 

Import Mode

Captura.PNG

DirectQuery

Captura2.PNG

Thanks a lot. Regards.

omiranda
Regular Visitor
YearOriginMedia
2020MUTUACTIV S.G114,67
2020INVERSIONES108,00
2020MUTUACTIV S.G114,17
2020INVERSIONES105,33
2020INVERSIONES104,17
2020MUTUACTIV S.G111,83
2020INVERSIONES107,50
2020INVERSIONES105,17
2020MUTUACTIV S.G107,61
2020INVERSIONES113,67
2020INVERSIONES104,33
2020MUTUACTIV S.G114,67
2020INVERSIONES107,83
2020INVERSIONES109,33
2020INVERSIONES112,83
2020INVERSIONES110,33
2020MUTUACTIV S.G110,67
2020MUTUACTIV S.G114,67
2020INVERSIONES106,50
2020INVERSIONES112,83
2020INVERSIONES101,67
2020MUTUACTIV S.G110,50
2020INVERSIONES105,50
2020MUTUACTIV S.G111,33
2020MUTUACTIV S.G105,83
2020MUTUACTIV S.G110,67
2020MUTUACTIV S.G109,17
2020MUTUACTIV S.G114,50
2020MUTUACTIV S.G117,86
2020MUTUACTIV S.G111,17
2020INVERSIONES110,00
2020MUTUACTIV S.G115,83
2020MUTUACTIV S.G108,53
2020MUTUACTIV S.G117,00
2020INVERSIONES109,00
2020INVERSIONES106,33
2020INVERSIONES107,14
2020MUTUACTIV S.G111,17
2020MUTUACTIV S.G114,67

It is a sample, therefore it will not give the result indicated in the question
Thanks for your help😊

v-lili6-msft
Community Support

hi  @omiranda 

I couldn't use this measure in your above sample data, if possible, could you please share a pbix file that by import mode, that will be a great help.

 

Regards,

Lin