Return value based on most recent date

Hi All,

As a beginner to Power BI I probably have a relatively easy question :sweat_smile: :

I have a fact table that contains the price history of a certain asset (column named close):

Now I created a what if parameter in which the user can input the amount of stocks he owns. As a small detail I would like to create a card which shows the current total $ value of his holdings.

In other words: Todays value of the asset * the amount of stocks he owns.

I tried to create a formula with the LASTDATE function, but until now I haven’t succeeded.

It would be great if someone is willing to help me out.

Thank you,


Hello Folkert,

Can you provide a pbix sample of the scenario?

Thanks, so much!

PBIX example.pbix (155.3 KB)

Yes of course, please find attached.
Just to be clear: Todays value = the ‘closed’-column price of the most recent date in the table.


Here’s a solution I worked up based on some sample date I had from another forum response. I’m sure there is a more efficient way to do this, but as is often said on this forum “if it works, it ain’t dumb”…

Most Recent Price = 

VAR PriceDate =
    MAX( 'HRC Data'[Date] ),
    'HRC Data'[Price] <> BLANK()

VAR LatestPrice =
    SELECTEDVALUE( 'HRC Data'[Price] ),
    'HRC Data'[Date] = PriceDate



Hope this is helpful. Solution file attached.



Awesome, it worked, Cheers :smiley:

To the contributors of this post, thank you for all your inputs on this topic we are now tagging it as Solved. To help us learn more about your experience in the forum, please take a moment to answer this short forum survey. We appreciate all your help and suggestions. Thanks!