cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rs1249 Frequent Visitor
Frequent Visitor

return a text based on several conditions using lookupvalue

Hi Guys, I have a table with these columns and value:

Name Entry_Type Document_No Doc No Cust_Ledger_Entry_No
10Bit FX Application CRD-0000166 24497
10Bit FX Initial Entry INV-0001367 INV-0001367 24497
10Bit FX Application CRD-0000166 24526
10Bit FX Initial Entry CRD-0000166 CRD-0000166 24526
10Bit FX Application BANK-0000675 24541
10Bit FX Initial Entry INV-0001368 INV-0001368 24541
10Bit FX Application BANK-0001422 24556
10Bit FX Initial Entry INV-0001369 INV-0001369 24556
10Bit FX Application BANK-0000675 27027
10Bit FX Initial Entry BANK-0000675 BANK-0000675 27027
10Bit FX Application BANK-0001422 36537
10Bit FX Initial Entry BANK-0001422 BANK-0001422 36537
10Bit FX Application BANK-0001961 38950
10Bit FX Initial Entry INV-0002424 INV-0002424 38950
10Bit FX Application BANK-0001961 40910
10Bit FX Initial Entry BANK-0001961 BANK-0001961 40910

I create a measure call the doc no to return doc no of the Inital Entry to all all associated rows for each customer ledger entry no.

Doc No =
Var currentitem =SELECTEDVALUE(Detailed_Cust_Ledg_Entries[Entry_Type])
var currentitem2 = SELECTEDVALUE(Detailed_Cust_Ledg_Entries[Entry_No])
var currentitem3 =SELECTEDVALUE(Detailed_Cust_Ledg_Entries[Document_No])
return
SWITCH(True(),
currentitem = "Initial Entry",currentitem3,
currentitem="application",LOOKUPVALUE(Detailed_Cust_Ledg_Entries[Document_No],Detailed_Cust_Ledg_Entries[Entry_Type],"Initial Entry",Detailed_Cust_Ledg_Entries[Entry_No],currentitem2))
 
The first switch statement worked, as you can see in the table, but second one with Lookupvalue function doesn't work, I just can't see why?
 
Please help me!!! thanks in advance

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors