Forum Discussion
Lookup Value inside another lookup
I need help with a preety simple problem, I have a simple base such as:
| License Plate | Shipping co Name | Route |
| AAA1000 | A | 1010 |
| AAA1000 | A | 1020 |
| BBB2000 | A | 2010 |
| CCC3000 | A | 3010 |
| CCC3000 | A | 3020 |
| CCC3000 | B | 3030 |
| CCC3000 | C | 3040 |
| DDD4000 | A | 4010 |
| DDD4000 | B | 4020 |
| DDD4000 | B | 4030 |
| EEE5000 | B | 5010 |
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 Plate | Qty of Shipping co | Registered to B? |
| AAA1000 | 1 | No |
| BBB2000 | 1 | No |
| CCC3000 | 3 | Yes |
| DDD4000 | 2 | Yes |
| EEE5000 | 1 | Yes |
However the best that I got was using the FIRSTNONBLANK formula and get the first company that appeard in the data set:
| License Plate | Qty of Shipping co | Shipping co Name |
| AAA1000 | 1 | A |
| BBB2000 | 1 | A |
| CCC3000 | 3 | A |
| DDD4000 | 2 | A |
| EEE5000 | 1 | B |
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
3 Replies
- Jihwan_KimSuper 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.
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
- AnonymousNot 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
- Jihwan_KimSuper User
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