Forum Discussion
Relative age?
grggmrtn ok I get it, but the question is where is the relative date sitting, is that from the slicer? how does the relative date relate to the person? You obviously need to calculate it based on the relative year. But what is that relative year based on in your date? the date in dim date that is linked to your factless fact?
vanessafvgI think I'm going to have to end this thread with a "thanks for trying" - I'm beginning to realise that the complexity of the datamodel is going to make it pretty much impossible to explain the problem without sharing a LOT more than just dummy data, and that would break too many rules 😉
Sorry, but I really appreciate your effort anyhow 🙂
- Stachu6 years agoCommunity Champion
if I understand the problem correctly you have a star schema model, and you want to calculate the age of a customer based on a Calendar table rather than fixed value (TODAY()), is that correct?
try this codeRelative Age = VAR __CurrentDate = MAX(Dim_Date[KEY_Date]) DATEDIFF( MAX(Dim_Customer[Birthday]); __CurrentDate; YEAR )it should work as long as Year in the X axis is from the Dim_Date table