“incorrect ranking power bi-dax” 翻译为中文是 “Power BI-DAX 错误的排名”。

huangapple go评论65阅读模式
英文:

incorrect ranking power bi-dax

问题

我有一个包含以下数据的数组:

组别    材料    值
 1      a1      10
        a2      23
        a3       1
        ..
        an      32

2       b1      10
        b2       2
        b3      23
        ..
        bn       1

我想要得到一个排名,但不是像这样给我值:

1
2
3
..
10

而是得到以下结果:

组别    材料    值     排名
 1      a1      10     12
        a2      23     23
        a3       1     40
        ..
        an      32     3

2       b1      10     11
        b2       2     39
        b3      23     24
        ..
        bn       1     42

这是我的公式:

RANKX( FILTER( 'table','table'[group]  = EARLIER('table'[group])),'table'[value], , DESC)

我还有其他要筛选的字段,比如center和date,但它们不在矩阵显示中。有没有办法修改我的排名?谢谢。

英文:

I HAVE AN ARRAY WITH THE FOLLOWING DATA

group    mat    value
 1       a1      10
         a2      23
         a3       1
         ..
         an      32

2        b1      10
         b2       2
         b3      23
         ..
         bn       1

i want to get a rank but instead of giving me values like
1
2
3
..
10

i get the following

group    mat    value   rank
 1       a1      10     12
         a2      23     23
         a3       1     40
         ..
         an      32     3

2        b1      10     11
         b2       2     39
         b3      23     24
         ..
         bn       1     42

this is my formula:

RANKX( FILTER( 'table','table'[group]  = EARLIER('tabla'[group])),'tabla'[value], , DESC)

and I have other fields to filter such as center and date but they are not in the matrix display
any idea how to change my ranking? Tanks

答案1

得分: 0

首先,使用“Transform Data”功能,填充“Group”列的数值。

然后编写一个度量值:

Measure = SUM(Data[value])

接下来编写一个排名度量值:

Rank = RANKX(ALLEXCEPT(Data, Data[group]), [Measure])

如果你想要在中心和日期上进行筛选,请将这些列添加到ALLEXCEPT筛选条件中:

Rank = RANKX(ALLEXCEPT(Data, Data[group], Data[center], Data[Date]), [Measure])
英文:

First using Transform Data, Fill down values for Group column

“incorrect ranking power bi-dax” 翻译为中文是 “Power BI-DAX 错误的排名”。

Then write a measure

Measure = SUM(Data[value])

Then write a Rank measure

Rank = RANKX(ALLEXCEPT(Data, Data[group]), [Measure])

If you want filter on center and date then give those columns in ALLEXCEPT filter

Rank = RANKX(ALLEXCEPT(Data, Data[group], Data[center], Data[Date]), [Measure])

“incorrect ranking power bi-dax” 翻译为中文是 “Power BI-DAX 错误的排名”。

huangapple
  • 本文由 发表于 2023年6月8日 10:48:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76428287.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定