Forum Discussion
How to conditional relate to another table
- 3 years ago
you can try this
Column = if(Deatiled_Cust_Ledg[Entry_Type]="Initial Entry",LOOKUPVALUE('Cust_Ledg'[Index],Cust_Ledg[Entry_No],'Deatiled_Cust_Ledg'[Cust_Ledger_Entry_No])) Column 2 = if(Deatiled_Cust_Ledg[Column]="", maxx(FILTER('Deatiled_Cust_Ledg','Deatiled_Cust_Ledg'[Document_No]=EARLIER(Deatiled_Cust_Ledg[Document_No])&&Deatiled_Cust_Ledg[Entry_No]<=EARLIER('Deatiled_Cust_Ledg'[Entry_No])&&Deatiled_Cust_Ledg[Column]<>""),Deatiled_Cust_Ledg[Column]),Deatiled_Cust_Ledg[Column])pls see the attachment below
it looks like there are not matching entry number,
if([Entry_Type]="Initial Entry",RELATED(Cust_LedgerEntries[Index]) will return empty for the column
what's the expected output based on your sample data?
Hi Guys, the relationsship is Detailed_Cust_Ledg[Cust_Ledger_Entry_No]->Cust_Ledg[Entry_No] *->1
on the top table the 7th Column is matched to botton table 1st column, so the end result should be in the top table last column, it should pulling in the index value from the bottom table index column, but it looks at the top table's 3rd column "Entry_Type" and 7th Column "Cust_Ledger_Entry_No", doing something like this:
If 3rd column [Entry_Type] value is "Initial Entry" Lookup (Cust_LedgerEntries[Index]) base on 7th Column "Cust_Ledger_Entry_No", if not, copy the same Cust_LedgerEntries[Index]) that is above until the next [Entry_Type]="Initial Entry"
Hope that make sense
- ryan_mayu3 years agoSuper User
you can try this
Column = if(Deatiled_Cust_Ledg[Entry_Type]="Initial Entry",LOOKUPVALUE('Cust_Ledg'[Index],Cust_Ledg[Entry_No],'Deatiled_Cust_Ledg'[Cust_Ledger_Entry_No])) Column 2 = if(Deatiled_Cust_Ledg[Column]="", maxx(FILTER('Deatiled_Cust_Ledg','Deatiled_Cust_Ledg'[Document_No]=EARLIER(Deatiled_Cust_Ledg[Document_No])&&Deatiled_Cust_Ledg[Entry_No]<=EARLIER('Deatiled_Cust_Ledg'[Entry_No])&&Deatiled_Cust_Ledg[Column]<>""),Deatiled_Cust_Ledg[Column]),Deatiled_Cust_Ledg[Column])pls see the attachment below