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
NFI27
Helper I
Helper I

Dax to lookup from multiple values

Hello,

 

I am a fairly new user to power bi. i have question regarding the lookup from multiple values. Lets say i have a table named (production) with the items (reference numbers) that are in production and i have another table lets say (entry)with the items (reference number)and entry date to the warehouse.

 

I want to use the lookup function to find out wich item in the (production) table does not have an entry date in the (entry) table, thus determine that this item is new.

 

 

Keep in mind there are multiple values (a lot of repeated reference numbers) in the entry table.

 
I want to use the function to determin which item has never been in the warehouse.

 

Thanks in advance sorry if this has been said before                                            

 

1 ACCEPTED SOLUTION

Hi @NFI27

 

You may try below formula:

PRODUCTION =
VAR NewDate =
    CALCULATE (
        MAX ( entry[ENTRY] ),
        FILTER ( entry, entry[ITEM] = production[ITEM] )
    )
RETURN
    IF ( NewDate = BLANK (), "New", NewDate )

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
NFI27
Helper I
Helper I

To add on to the explanation:

 

an example:

 

If this were two seperate tables how could i use the lookup function to determine that disk is new (given the fact that it has no entry date

 

ITEMENTRY ITEMPRODUCTION
Hammer01/05/2018 hammer01/09/2018
Drill02/05/2018 Drill02/08/2018
Knife01/06/2018 DiskNEW
Saw15/06/2018 Saw15/06/2018
Drill02/08/2018 Knife01/06/2018
Hammer 01/09/2018   

Hi @NFI27

 

You may try below formula:

PRODUCTION =
VAR NewDate =
    CALCULATE (
        MAX ( entry[ENTRY] ),
        FILTER ( entry, entry[ITEM] = production[ITEM] )
    )
RETURN
    IF ( NewDate = BLANK (), "New", NewDate )

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.