我用谷歌搜索并继续使用太慢的公式 . 我怀疑如果我按步骤分割公式(创建计算列),我可能会看到一些性能提升 .
我有一个表有一些数字列和一些最终将作为切片 . 目的是在所选切片器的某些数字列上具有10%,25%,50%,75%和90%的百分位数 .
这就是我对“总钯”栏目中的第10个百分位数的看法 .
TotalPaid10thPercentile:=MINX(
FILTER(
VALUES(ClaimOutcomes[Total Pd]),
CALCULATE(
COUNTROWS(ClaimOutcomes),
ClaimOutcomes[Total Pd] <= EARLIER(ClaimOutcomes[Total Pd])
)> COUNTROWS(ClaimOutcomes)*0.1
),
ClaimOutcomes[Total Pd]
)
这需要几分钟,但仍然没有数据显示 . 我在这张表中有大约300K的记录 .
1 回答
我找到了一种方法,可以通过一系列步骤打破计算,从而获得了一个非常快速的解决方案 .
为了计算表
Data
中Amount Paid
的第10个百分位数,我遵循了下面的书外公式:Calculate the Ordinal rank for the 10th percentile element
它可能会出现一个十进制(分数)数字,如112.45
Compute the decimal part
Compute the ordinal rank of the element just below(floor)
Compute the ordinal rank of the element just above(ceiling)
Compute element corresponding to floor
Compute element corresponding to ceiling
Compute the percentile value
我发现性能明显快于我在网上找到的其他解决方案 . 希望它能帮助将来的某个人 .