Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
fmaestri
Frequent Visitor

get value of last row to create index numbers

Greetings,

I've seen this question many times, and I even used chat gpt to get it, but it just don't work. A recurrent thing I need to do is create index numbers, that is taking the first value as 100 (or 1 or 100%) and the next values is the porcentual variation. I always do this in excel extremly easy, buy after 2 years of power bi I just don't get it.

How do I actually get the value of the last row? Earlier never worked for me.

I want this:

DateValueLast value
MarchA 
AprilBA
MayCB
JuneDC

 

And i've tried many, many things, like this one, and I just get a blank row:

 

 

 

 

last_value = 
IF(
    NOT(Table[date]=MIN(Table[date])),
    CALCULATE(
        MAX('Table'[value]),
        FILTER(
            ALL('Agregados'),
            'Table'[date] = Table[date] - 1
        )
    )
)

 

 

 

 

 

My goal is to have variations like this, but I would love to get as a variable the last row value. The index values I need to create look like this:

DateValueindex
MarchA100
AprilB103,1
MayC108,3
JuneD113,5
.........

 

Any ideas in a extremly easy way? Thanks a lot!

1 ACCEPTED SOLUTION
Daniel29195
Super User
Super User

@fmaestri 

Daniel29195_0-1706196831893.png

 

use this code in a calculated column : 

Column =
SELECTCOLUMNS(
OFFSET(-1,
    all(Table24[Value],Table24[index]),
    ORDERBY(Table24[index], asc)
) ,Table24[Value]
)
 
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos button👍🤠
 
 

 

View solution in original post

3 REPLIES 3
Daniel29195
Super User
Super User

@fmaestri 

Daniel29195_0-1706196831893.png

 

use this code in a calculated column : 

Column =
SELECTCOLUMNS(
OFFSET(-1,
    all(Table24[Value],Table24[index]),
    ORDERBY(Table24[index], asc)
) ,Table24[Value]
)
 
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos button👍🤠
 
 

 

Thank you! That was very fast and works perfectly. ❤️

@fmaestri 

i forgot to mention, that you can orderby any column you want , 

i created index for the date column so that i can sort asc by date 

 

 

 

 

 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos button

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.