Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
In the PriceHistory table contains MemberId, Price and the [Date] when the price was captured
In the Member table contain memberId and reporDate.
I need to calculate a column [Price] in the member table to look for the rows for the memberId in PriceHistory table where [Date] is less than the [reportDate] and take the price from the row with max[Date] from the rows.
Solved! Go to Solution.
@Anonymous,
Try this calculated column in table Member:
Price =
VAR vMemberId = 'Member'[MemberId]
VAR vReportDate = 'Member'[reportDate]
VAR vTable =
FILTER (
PriceHistory,
PriceHistory[MemberId] = vMemberId
&& PriceHistory[Date] < vReportDate
)
VAR vMaxDate =
MAXX ( vTable, PriceHistory[Date] )
VAR vResult =
MAXX ( FILTER ( vTable, PriceHistory[Date] = vMaxDate ), PriceHistory[Price] )
RETURN
vResult
Proud to be a Super User!
@Anonymous,
Try this calculated column in table Member:
Price =
VAR vMemberId = 'Member'[MemberId]
VAR vReportDate = 'Member'[reportDate]
VAR vTable =
FILTER (
PriceHistory,
PriceHistory[MemberId] = vMemberId
&& PriceHistory[Date] < vReportDate
)
VAR vMaxDate =
MAXX ( vTable, PriceHistory[Date] )
VAR vResult =
MAXX ( FILTER ( vTable, PriceHistory[Date] = vMaxDate ), PriceHistory[Price] )
RETURN
vResult
Proud to be a Super User!