Forum Discussion
Anonymous
4 years agoNot applicable
Return Top row result
I have a table in fact that I have a calculation of a KPI, in the DAX view I need to return the result of the previous axis as shown in the image below from a dimension table. Example, 2021 Q3 th...
- 4 years ago
Hi, Anonymous ;
You can use the Label_ period column directly, without the aid of rank. Please try it.
KPI 2 = CALCULATE ( SUM ( [KPI] ), FILTER ( ALL ( 'Table' ), [label_ period] = MAXX ( FILTER ( ALL ( 'Table' ), [label_ period] < MAX ( 'Table'[label_ period] ) ), [label_ period] ) ) )The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
4 years agoHi, Anonymous ;
You can use the Label_ period column directly, without the aid of rank. Please try it.
KPI 2 =
CALCULATE (
SUM ( [KPI] ),
FILTER (
ALL ( 'Table' ),
[label_ period]
= MAXX (
FILTER ( ALL ( 'Table' ), [label_ period] < MAX ( 'Table'[label_ period] ) ),
[label_ period]
)
)
)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
v-yalanwu-msft,
Thank you very much, it worked perfectly.
Ps. Talesfg