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
Anonymous
Not applicable

Lookup Value inside another lookup

I need help with a preety simple problem, I have a simple base such as:

 

License PlateShipping co NameRoute
AAA1000A1010
AAA1000A1020
BBB2000A2010
CCC3000A3010
CCC3000A3020
CCC3000B3030
CCC3000C3040
DDD4000A4010
DDD4000B4020
DDD4000B4030
EEE5000B5010

 

As you can see a truck can have multiple routes and multiple shipping companys, I need to check wheter or not a license plate is registered to a especific shipping company with the desired outcome:

 

License PlateQty of Shipping coRegistered to B?
AAA10001No
BBB20001No
CCC30003Yes
DDD40002Yes
EEE50001Yes

 

However the best that I got was using the FIRSTNONBLANK formula and get the first company that appeard in the data set:

 

License PlateQty of Shipping coShipping co Name
AAA10001A
BBB20001A
CCC30003A
DDD40002A
EEE50001B

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

Thank you for your feedback.

If you want to create a new table, the formula is different.

Please try the below for creating a new table.

 

New Table =
SUMMARIZE (
'Table',
'Table'[License Plate],
"Qty of shipping co", DISTINCTCOUNT ( 'Table'[Shipping co Name] ),
"Registered to B", IF ( { "B" } IN VALUES ( 'Table'[Shipping co Name] ), "Yes", "No" )
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

All measures are in the sample pbix file.

 

Picture2.png

 

Registered to B =
IF (
ISFILTERED ( 'Table'[License Plate] ),
IF ( { "B" } IN VALUES ( 'Table'[Shipping co Name] ), "Yes", "No" )
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Hello @Jihwan_Kim, thanks for your reply.

 

It worked great on the report, however I need this formulas to work on the tables, so I can use the information as a filter to create a few charts. I tried using the same formula, but it didn't work

Hi, @Anonymous 

Thank you for your feedback.

If you want to create a new table, the formula is different.

Please try the below for creating a new table.

 

New Table =
SUMMARIZE (
'Table',
'Table'[License Plate],
"Qty of shipping co", DISTINCTCOUNT ( 'Table'[Shipping co Name] ),
"Registered to B", IF ( { "B" } IN VALUES ( 'Table'[Shipping co Name] ), "Yes", "No" )
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.