cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GLIDO
Helper I
Helper I

RELATED function not working

Hi Community People, 

 

I have three tables the relation among them is Relation_Tables.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

where TENANT.ID=LOAN_APPLICATION.TENANT_ID and 

           "Login Acceptance Date". "Application Number"= LOAN_APPLICATION.APPLICATION_NUMBER

 

Now we are required to create a measure, "Carry Over Leads" with the following formula, FormulaError.JPG

 

 

 

 

 

 

Now the issue is, I can't access the tenant table by using related function to compare to a field of login acceptance date. 

 

Can anyone help me out in this ? I am quite new to Power BI. I tried RELATED TABLES too but that also doesn't seem the correct option. All the joins are active and Cross Filter Direction has been set to both.

 

Thanks in advance

 

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

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.

 

1.png

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/g4rjig9r5zbb1mo/RELATED3.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

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.

 

1.png

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/g4rjig9r5zbb1mo/RELATED3.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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, Relation_Tables.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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. 

 

 

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors