Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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]))) )
User | Count |
---|---|
53 | |
28 | |
19 | |
18 | |
14 |
User | Count |
---|---|
92 | |
86 | |
39 | |
23 | |
22 |