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

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, @GabrielKoch 

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 accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

3 REPLIES 3
Jihwan_Kim
Community Champion
Community Champion

Hi, @GabrielKoch 

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 accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

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, @GabrielKoch 

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 accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors