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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JbPa33
Helper I
Helper I

Recover the last date according to a slicer

Hello,

 

I am realising a power BI rapport and I am blocking on a date problem : 

JbPa33_1-1649056354538.png

I have a first table which lists the different amounts for a project numero. I want to created a second table where I recover the last amount from the first table. In this example, in the second table, i would like to have 213L183301 - 616 918,53. If I select date_comptabilisation between 01/07/2020 and 31/12/2020, i would like that the second table displays 414 281.06.

 

Is there a way to solve this problem ?

 

Thank you !

1 ACCEPTED SOLUTION
rbriga
Impactful Individual
Impactful Individual

I've created a measure that yields 1 or 0:

Max Date Filter = 
VAR _MaxDate = 
    CALCULATE(
         MAX(Table1[Date])
        ,ALLSELECTED(Table1[Date])
        , KEEPFILTERS(Table1[Project] = SELECTEDVALUE(Table1[Project]))
    )
RETURN
CALCULATE(
    IF(SELECTEDVALUE(Table1[Date]) = _MaxDate,1,0)
    , KEEPFILTERS(Table1[Project] = SELECTEDVALUE(Table1[Project]))
    )

Now, add this measure to the visual's filter:

Victory!Victory!

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

2 REPLIES 2
JbPa33
Helper I
Helper I

Thank you so much, it's exactly what I wanted !

rbriga
Impactful Individual
Impactful Individual

I've created a measure that yields 1 or 0:

Max Date Filter = 
VAR _MaxDate = 
    CALCULATE(
         MAX(Table1[Date])
        ,ALLSELECTED(Table1[Date])
        , KEEPFILTERS(Table1[Project] = SELECTEDVALUE(Table1[Project]))
    )
RETURN
CALCULATE(
    IF(SELECTEDVALUE(Table1[Date]) = _MaxDate,1,0)
    , KEEPFILTERS(Table1[Project] = SELECTEDVALUE(Table1[Project]))
    )

Now, add this measure to the visual's filter:

Victory!Victory!

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.