Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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

 

  • 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

  • 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

    • Anonymous's avatar
      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

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super 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