1
votes

I have a Power BI table looks like this:

Cat Price Date
apple 2.0 03/21/2021
peach 3.0 03/22/2021
apple 1.8 03/18/2021
apple 2.0 03/19/2021
peach 3.1 03/20/2021
apple 1.7 03/17/2021

I want to use a date slicer and Cat filter to choose the latest price for Apple and display in a tile:

Date Slicer: 03/12/2021 - 03/21/2021
Filter: check 'apple'

Tile display: 2.0

I tried

price_LastValue := CALCULATE(SUM(fruit[Price]), LASTDATE(fruit[Date]))

but the result is BLANK. Any thoughts?

1
I couldn't replicate your error, Is the selection of date meant to be outside the range of the selected CAT?Angelo Canepa
I could not reproduce your problem either. There is something else in your Power BI model that affects your results but you have not included in the question. Could you post your data model diagram?RADO

1 Answers

0
votes
price_LastValue = 
VAR _tbl = ALLSELECTED(Table1)
VAR _max_date = MAXX(_tbl, [Date])
RETURN MINX(FILTER(_tbl, [Date] = _max_date), [Price])

enter image description here