我的任务是将工作表从标准 Excel 转换为 PowerPivot。但是,我遇到了 DAX 中不可用的 PERCENTRANK.INC 函数的障碍。我已经接近使用公式来复制它,但是计算上有明显的差异。
有谁知道 Excel 如何计算 PERCENTRANK.INC()?
Formula in cell D2: =(COUNT($A$2:$A$10)-B2)/(COUNT($A$2:$A$10)-1)
Formula in cell B2: =RANK.EQ(A2,$A$2:$A$10,0)
Formula in cell C2: =PERCENTRANK.INC($A$2:$A$10,A2)
最佳答案
编辑:
我觉得很奇怪有这么多“标准”的计算方法PERCENTRANK
结果略有不同。
使用您的 9 位数集 1,2,3,4,4,6,7,8,9
的示例,根据我使用的“权威”,第三个值(3
)的百分比排名为 25.0%, 27.0%, 27.8% or 30.0%
.
显然,我们会选择能提供您想要的结果的那个,匹配 PERCENTRANK.INC
.
PERCENTRANK.INC
is calculated as:[count of values lower than the given value]
÷
[count of all values in the set excluding the given value]
所以,如果我们的范围
1,2,3,4,4,6,7,8,9
在 A1:A9
, 我们可以在 B1
中使用这个公式:=COUNTIF($A$1:$A$9,"<"&A1)/(COUNT($A$1:$A$9)-1)
...并复制或“填充”它以获得结果:
0.0%, 12.5%, 25.0%, 37.5%, 37.5%, 62.5%, 75.0%, 87.5%, 100.0%
原始答案
I think you just want to calculate the
PERCENTRANK
for current row value. Based on the logic forPERCENTRANK
, we can add aRANK
column in table and achieve same logic based on this column.Create a
Rank
column.Rank = RANKX(Table6,Table6[Value])
Then create the
PctRank
based on theRank
column.PctRank = (COUNTA(Table6[Name])-Table6[Rank])/(COUNTA(Table6[Name])-1)
(Source)
关于excel - 在 PowerPIvot/DAX 中获取 PERCENTRANK.INC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49341558/