Forum Discussion
Return a corresponding value from another table based on calculated measure
- 4 years ago
Anonymous
Not enough information but can you try the following meaure:RateMeasure = VAR __AgeSelected = MAX ( ThisTable[MachineAge] ) RETURN CALCULATE ( MAX ( AgeTablename[Buyback rate %] ), AgeTablename[Age] = __AgeSelected )Replace the table and columns names as per your model
- Anonymous4 years ago
Hey! The measure that you posted was unfortunately not working directly (blame is on me, I didn't provide enough information). Luckily I got the measure working, adding the rounddown function on the age and deleting the Max statement from "var age" function was the key as shown below.
Machine age := var age = (MAX(vDimCalendar[Date]) - MAX(Buybacks[Delivered (month/year)])) / 365 * 12 return ROUNDDOWN(age, 0) --------------------------------------------------------------------------------------------- Buy-back policy rate := VAR __AgeSelected = 'Measures table'[Machine age] RETURN CALCULATE ( MAX ( 'Buyback policy rates'[Trade-in] ), 'Buyback policy rates'[Month] = __AgeSelected )
Anonymous
Not enough information but can you try the following meaure:
RateMeasure =
VAR __AgeSelected =
MAX ( ThisTable[MachineAge] )
RETURN
CALCULATE (
MAX ( AgeTablename[Buyback rate %] ),
AgeTablename[Age] = __AgeSelected
)
Replace the table and columns names as per your model
Hey! The measure that you posted was unfortunately not working directly (blame is on me, I didn't provide enough information). Luckily I got the measure working, adding the rounddown function on the age and deleting the Max statement from "var age" function was the key as shown below.
Machine age :=
var age = (MAX(vDimCalendar[Date]) - MAX(Buybacks[Delivered (month/year)])) / 365 * 12
return
ROUNDDOWN(age, 0)
---------------------------------------------------------------------------------------------
Buy-back policy rate :=
VAR __AgeSelected =
'Measures table'[Machine age]
RETURN
CALCULATE (
MAX ( 'Buyback policy rates'[Trade-in] ),
'Buyback policy rates'[Month] = __AgeSelected
)