powerbidaxpowerbi-desktoppowerbi-datasource

How to tackle with below PowerBI query?


Below is the table, I am getting value of 1.0314 in column CurrentIndex, however i want the last value in column cummRateIndexCol (1.4634). I Used the below 2 queries

currentIndex =
MAXX (
    FILTER ( ALLSELECTED ( 'Year Rank' ), 'Year Rank'[Year] = 2023 ),
    'Year Rank'[CummRateIndexCol]
)

This one is giving error cos CummRateIndexCol is measure and not the column :

currentIndex2 =
CALCULATE (
    MAX ( 'Year Rank'[CummRateIndexCol] ),
    FILTER ( 'Year Rank', 'Year Rank'[Year] = MAX ( 'Year Rank'[Year] ) )
)

enter image description here


Solution

  • Try this measure:

    currentIndex = 
    MAXX(ALL('Year Rank'), [CummRateIndexCol])
    

    Output:

    Output Image