Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I would like to find Price as of date range (Only last record id (RECID) if found multiple record in that date range)
Group by S_UNIT
I try DAX below
Price =
VAR ASOF = LASTDATE(DimDate[Date])
RETURN
CALCULATE(
SUM(fPriceTable[UNITPRICE]),
FILTER(fPriceTable,
fPriceTable[RECID] =
CALCULATE(
MAX(fPriceTable[RECID]),
FILTER(fPriceTable,
fPriceTable[FROMDATE] <= ASOF
&& fPriceTable[TODATE] >= ASOF
)
)
)
)
The green result is ok
How can i get Price in red result = 0 and correct the Total line
Solved! Go to Solution.
@peerasit_ary , Try a measure like
Last = calculate(max(Table[Unit Price]), filter(Table, Table[to_date] = calculate(max(Table[Project_Step]), allexcept(Table, Table[S Unit]))) )
@peerasit_ary , Try a measure like
Last = calculate(max(Table[Unit Price]), filter(Table, Table[to_date] = calculate(max(Table[Project_Step]), allexcept(Table, Table[S Unit]))) )