Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
setis
Post Partisan
Post Partisan

LOOKUPVALUE help

Dear all, I am struggling with a relative simple issue. 

 

I have 2 tables, [Receivables] and [Payables]

 

These 2 tables are joined through: 

Payables [External No.] to Receivables [Document No.]) on a 1 to many. (1 [Document No.] can have many [External No.])
 
I am trying to see which lines in [Receivables] does or does not have a match in [Payables].
 
I achieved this with a measure:
Invoice status = 
IF(ISBLANK(
CALCULATE(COUNTA(Receivables[Document No.]);
            FILTER(ALL(Receivables);
                    Receivables[Document No.]=(MAX('Payables[External No.])))));"Not Invoiced";"Invoiced")
but I actually need this as a calculated column in the table [Receivables]
 
I am trying different things but nothing is working for me. Last attemp was:
 
Inv. status(WRONG) = 
IF(HASONEVALUE('Payables'[External Document No.]);
LOOKUPVALUE('Payables'[Entry No.];'Payables'[External No.];Receivables[Document No.]);"")
Could someone point me in the right direction, please?
1 ACCEPTED SOLUTION
ChrisMendoza
Resident Rockstar
Resident Rockstar

@setis -

 

Maybe this will work for you:

Column =
VAR countReceivables =
    CALCULATE (
        COUNTROWS ( Payables ),
        ALLEXCEPT ( Receivables, Receivables[Document No.] )
    )
RETURN
    IF ( ISNUMBER ( countReceivables ), "Invoiced", "Not Invoiced" )

3.PNG2.PNG4.PNG

 

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
ChrisMendoza
Resident Rockstar
Resident Rockstar

@setis -

 

Maybe this will work for you:

Column =
VAR countReceivables =
    CALCULATE (
        COUNTROWS ( Payables ),
        ALLEXCEPT ( Receivables, Receivables[Document No.] )
    )
RETURN
    IF ( ISNUMBER ( countReceivables ), "Invoiced", "Not Invoiced" )

3.PNG2.PNG4.PNG

 

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Dear @ChrisMendoza,

 

It does work. Thank you so much!

 

I really appreciate you taking the time to create a file and check this for me. I should have included a file myself. 🙂

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.