I'm using Excel 265.
I have a list of stock transactions imported via Power Query using an SQL-Server connection loaded to the data model.
I want to create a Pivot table called 'PivotTable1' to return a unique list of 'ITEMID's.
Then have the second column in the Pivot return the most recent 'UNIT_PRICE' per 'ITEM_ID' in the Pivot.
The idea is I can then slice the pivot to a date in the past and the Pivot will return the most recent price for each item up to that date.
Additional context I think the slightly more efficient way to handle this is to prefilter the data in SQL to only give me the most recent dates per item based on a date the user provides. I can then handle this request using a cell and a button to fire off some VBA. Then when the pivot populates it's only pulling one row of data per date, per location. However it would still be nice to know if I could force this to work in DAX.