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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
FrancoIVM
New Member

Use the current row date

Hi,

I want to calculate the last price from a column filter by date, but i want that the dates that are being evaluated ends at the current date of the row.

 

something like:

Last price bt = CALCULATE(
LASTNONBLANKVALUE(
table[dates],
SUM(table[prices])),
DATESBETWEEN(table[dates],FIRSTDATE(table[dates]),
"""end_date"""))
 
I want that end_date can be the date of the current row if that is posible. Like:
Table:
[Dates] [Price] [Last price] [Last price bt]  
1-1-1    100          150             100
1-1-2                    150             100
1-1-3                    150             100
1-1-4     120         150             120
1-1-5     150         150             150
 
 
 
 
1 ACCEPTED SOLUTION
DataZoe
Microsoft Employee
Microsoft Employee

Hi @FrancoIVM , please try this measure:

Previous Price =
CALCULATE (
    LASTNONBLANKVALUE (
        'Table'[Dates],
        [Unit Price]
    ),
    FILTER (
        ALLSELECTED ( 'Table'[Dates] ),
        ISONORAFTER (
                'Table'[Dates], MAX ( 'Table'[Dates] )DESC
        )
    )
)

DataZoe_0-1601943948717.png

 

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

1 REPLY 1
DataZoe
Microsoft Employee
Microsoft Employee

Hi @FrancoIVM , please try this measure:

Previous Price =
CALCULATE (
    LASTNONBLANKVALUE (
        'Table'[Dates],
        [Unit Price]
    ),
    FILTER (
        ALLSELECTED ( 'Table'[Dates] ),
        ISONORAFTER (
                'Table'[Dates], MAX ( 'Table'[Dates] )DESC
        )
    )
)

DataZoe_0-1601943948717.png

 

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.