Forum Discussion
RELATED function not working
- 8 years ago
Hi GLIDO,
As the picture you shared, actually there is no relationship between Login Acceptance Date and TENANT. So you cannot use the RELATED function here. Based on my test, we can take the following steps to meet your requirement.
1. Create a new column in LOAN_APPLICATION table.
Login date = RELATED('Login Acceptance Date'[Login date])
2. Create a new measure.Measure 2 = CALCULATE(COUNT(LOAN_APPLICATION[ID]),FILTER(LOAN_APPLICATION,LOAN_APPLICATION[date_of_receipt]<RELATED(TENANT[Start Date])),FILTER(LOAN_APPLICATION,LOAN_APPLICATION[Login date]<RELATED(TENANT[Start Date])))
3. Then we can get the result as below.
For more details, please check the pbix as attached.
https://www.dropbox.com/s/g4rjig9r5zbb1mo/RELATED3.pbix?dl=0
Regards,
Frank
Hi GLIDO,
As the picture you shared, actually there is no relationship between Login Acceptance Date and TENANT. So you cannot use the RELATED function here. Based on my test, we can take the following steps to meet your requirement.
1. Create a new column in LOAN_APPLICATION table.
Login date = RELATED('Login Acceptance Date'[Login date])
2. Create a new measure.
Measure 2 = CALCULATE(COUNT(LOAN_APPLICATION[ID]),FILTER(LOAN_APPLICATION,LOAN_APPLICATION[date_of_receipt]<RELATED(TENANT[Start Date])),FILTER(LOAN_APPLICATION,LOAN_APPLICATION[Login date]<RELATED(TENANT[Start Date])))
3. Then we can get the result as below.
For more details, please check the pbix as attached.
https://www.dropbox.com/s/g4rjig9r5zbb1mo/RELATED3.pbix?dl=0
Regards,
Frank
- GLIDO8 years agoHelper I
Hi v-frfei-msft,
Great great thanks for the solution, but that seemed more of a workaround.
In cases where I've to deal with over 8 10 tables, I don't think creating an instance of the target column(e.g. 'Login Acceptance Date'.'Login Acceptance Date') in the parent table(e.g LOAN_APPLICATION) is going to work there.
So what should be my approach when I have to fetch data through tables connected by 2 or more level of join.
I addition, talking about the current context,
In this case I can't create formulas having filters like,
FILTER(TENANT,TENANT['Start Date']>Related(LOAN_APPLICATION[DATE_OF_RECEIPT])) OR
FILTER('Login Acceptance Date'.'Login Acceptance Date'['Login Acceptance Date'])>Related(LOAN_APPLICATION[DATE_OF_RECEIPT]))
but I can create filters like
FILTER(LOAN_APPLICATION,LOAN_APPLICATION[DATE_OF_RECEIPT]<Related(TENANT['Start Date'])) and
FILTER(LOAN_APPLICATION,LOAN_APPLICATION[DATE_OF_RECEIPT]<Related('Login Acceptance Date'['Login Acceptance Date']))
Can you explain me this behaviour.