Search code examples
powerbipowerbi-desktoppowerbi-datasourcepower-bi-report-serverpowerbi-custom-visuals

How can I get the last value of a column in my dataset in power bi?


In the given table how to get the last value of a particular column in a dataset

Roll No Name Index  Score
1       ab1    1    23
2       ab2    2    43
3       ab3    3    42

Here we have to pick the Last Row Score value?


Solution

  • 1) The first thing we have to create a custom index column in the table

    2) Then we have to use the below formula to get the last Row Score value Score value

    CALCULATE(LASTNONBLANK(Table[Score], 1), FILTER(ALL(Table), Table[Index] = MAX(Table[Index])))
    

    The result would be 42.