Powerbi Dax从rankx测量中获得单秩结果

Powerbi Dax从rankx测量中获得单秩结果,powerbi,dax,Powerbi,Dax,如何从rankx测量中获得单个结果,例如,我需要“Test3”的结果,在本例中为3 DAX formula for rank: = RANKX( ALLSELECTED(CompetitionComp); CALCULATE( SUM(CompetitionComp[Base price WS]) ) ) 结果: Name Ranking test1 | 1 test2 | 2 test3 | 3 test4 | 4 ... 我不确定这是否是你想

如何从rankx测量中获得单个结果,例如,我需要“Test3”的结果,在本例中为3

DAX formula for rank: =
RANKX(
   ALLSELECTED(CompetitionComp);
   CALCULATE(
       SUM(CompetitionComp[Base price WS])
   )
)
结果:

Name    Ranking
test1  | 1
test2  | 2
test3  | 3
test4  | 4
...

我不确定这是否是你想要的:

DAX formula for rank 3: =
VAR _rank_3 = RANKX(
   ALLSELECTED(CompetitionComp);
   CALCULATE(
       SUM(CompetitionComp[Base price WS])
   )
)

RETURN IF(_rank_3 = 3, SUM(CompetitionComp[Base price WS]) )