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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nasolme
Helper I
Helper I

COLLECT LAST DATE VALUE FOR EACH YEAR

Hi community !

I work in real estate structured financed and i get the update of the real estate assets.

As you can see on the screenshot i attach, values are not updated every year. So i take the last known value as absolute value (see second screenshot).

I two tables : CALENDAR and VALUES HISTORY

How can i get the result of the second screen (with max value column) directly in POWER BI ? 

Capture d’écran 2022-04-11 122411.jpg

Capture d’écran 2022-04-11 122431.jpg

Thanks a lot for your time, take care of you,

Nasolme

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

Try:

Last value by Year =
VAR LY =
    CALCULATE (
        LASTNONBLANK ( 'Calendar Table'[Date], [Sum Valorisation] ),
        FILTER (
            ALL ( 'Calendar Table' ),
            'Calendar Table'[Date] <= MAX ( 'Calendar Table'[Date] )
        )
    )
RETURN
    CALCULATE (
        [Sum Valorisation],
        FILTER ( ALL ( 'Calendar Table' ), 'Calendar Table'[Date] = LY )
    )

Captura de pantalla 2022-04-11 162802.jpg

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

With this model:

model.jpg

 and this measure:

With Totals =
SUMX ( 'Deal Table', [Last value by Year] )

with totals.jpg

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

9 REPLIES 9
PaulDBrown
Community Champion
Community Champion

Try:

Last value by Year =
VAR LY =
    CALCULATE (
        LASTNONBLANK ( 'Calendar Table'[Date], [Sum Valorisation] ),
        FILTER (
            ALL ( 'Calendar Table' ),
            'Calendar Table'[Date] <= MAX ( 'Calendar Table'[Date] )
        )
    )
RETURN
    CALCULATE (
        [Sum Valorisation],
        FILTER ( ALL ( 'Calendar Table' ), 'Calendar Table'[Date] = LY )
    )

Captura de pantalla 2022-04-11 162802.jpg

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






That's exactly what i need. 

muchas Gracias

@PaulDBrown 

Just a last question, Is it possible to obtain the sum of the retained values ​​per year?
Capture d’écran 2022-04-12 125125.jpg
When I select more than one asset, last value per line work's fine but the grand total is false. I need to calculate portfolio ratios.

Thanks you

With this model:

model.jpg

 and this measure:

With Totals =
SUMX ( 'Deal Table', [Last value by Year] )

with totals.jpg

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






johnt75
Super User
Super User

You can try creating a measure as

Last known value =
var maxDate = MAX('Calendar'[Date])
return SELECTCOLUMNS( 
   CALCULATETABLE( TOPN(1, 'Values History', 'Values History'[Date_valorisation]), 
      REMOVEFILTERS('Calendar'[Date]), 'Values History'[Date_valorisation] <= maxDate ),
"@val", 'Values History'[Valorisation_total])

Hi @johnt75 and thanks you for your time,

But it doesn't works. I would like when i filter with calendrier[date], if i select 31/12/2021 power bi give me the last known value (12,5 M€), if i select 31/12/2018, he get 10, 9 M€ etc...

That's what I would expect this to return, and it seems to be working in my tests. What results are you getting ?

amitchandak
Super User
Super User

@nasolme ,

calculate( Lastnonblankvalue(Table[Date Valorization], max(Table[Valorization Value]) ))

 

calculate( Lastnonblankvalue(Date[Date], max(Table[Valorization Value]) ))

@amitchandak Thanks for your answer, but this isn't the expected result (see on screenshot) :

I need for each year a valuation who appear exactly like on the example given earlier.
With your solution, i get the same result without measure. 

Capture d’écran 2022-04-11 133654.jpg

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.