Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
1 year ago
Solved

How do I assemble a column from a table that queries data from another table?

Good afternoon

I have two tables: "INPO Details" and "Execution without CO". The "INPO Details" table is the one with the query information. The table "Execution without CO" needs to put together a column, in which it has to have the INPO detail, corresponding to the number that appears in the INPO row.

Table "Execution without CO"

Table of "INPO Details"

How do I add a column in the "Execution without CO" table, in which I query the "INPO details" table, to bring up the INPO detail corresponding to the INPO number.

I leave the program on google drive

https://drive.google.com/file/d/1I9Xhy0s7wKQMRMrjIRp_trbp__1EBi6c/view?usp=sharing

Thank you

Best regards.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Syndicate_Admin ,

    Thank you for reaching out to the Microsoft Fabric Community.

     

    We have reviewed your inquiry regarding the requirement to retrieve the corresponding INPO detail from the ‘Detalle INPOs’ table into the ‘Ejecución sin OC’ table, based on the shared INPO number. This is a common lookup scenario in Power BI, and we appreciate the clarity with which you’ve described your objective.

     

    We would like to confirm that both community responses provided by DataInsights   and Ashish_Mathur  technically correct:

     

    For your reference, here is the recommended formula:

    Detalle de INPO = LOOKUPVALUE(
        'Detalle INPOs'[Detalle],
        'Detalle INPOs'[Numero de Inpo],
        'Ejecución sin OC'[INPO]
    )
    

    Please ensure that the data types of both columns involved in the comparison (INPO and Numero de Inpo) are consistent (preferably whole numbers), and confirm that no ambiguity exists in the matching logic.

    If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

     

    Thankyou.

8 Replies

  • Try this calculated column in the "Execution without CO" table:

     

    Detalle de INPO = 
    VAR vINPO =
        CONVERT ( 'Ejecución sin OC'[INPO], INTEGER )
    VAR vResult =
        MAXX (
            FILTER ( 'Detalle INPOs', 'Detalle INPOs'[Numero de Inpo] = vINPO ),
            'Detalle INPOs'[Detalle]
        )
    RETURN
        vResult

     

     

     

  • Hi,

    Change the format of the INPO column to whole number.  Write this calculated column formula

    Detalle de INPO = LOOKUPVALUE('Detalle INPOs'[Detalle],'Detalle INPOs'[Numero de Inpo],'Ejecución sin OC'[INPO])

    Hope this helps.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin ,

    Thank you for reaching out to the Microsoft Fabric Community.

     

    We have reviewed your inquiry regarding the requirement to retrieve the corresponding INPO detail from the ‘Detalle INPOs’ table into the ‘Ejecución sin OC’ table, based on the shared INPO number. This is a common lookup scenario in Power BI, and we appreciate the clarity with which you’ve described your objective.

     

    We would like to confirm that both community responses provided by DataInsights   and Ashish_Mathur  technically correct:

     

    For your reference, here is the recommended formula:

    Detalle de INPO = LOOKUPVALUE(
        'Detalle INPOs'[Detalle],
        'Detalle INPOs'[Numero de Inpo],
        'Ejecución sin OC'[INPO]
    )
    

    Please ensure that the data types of both columns involved in the comparison (INPO and Numero de Inpo) are consistent (preferably whole numbers), and confirm that no ambiguity exists in the matching logic.

    If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

     

    Thankyou.

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Thank you all very much! I didn't know the LOOKUPVALUE feature!.

      Thank you!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hello Syndicate_Admin ,

         

        Thank you for your follow-up, and we’re glad to hear that the LOOKUPVALUE function addressed your requirement effectively.

        This function is indeed a powerful and widely used approach in Power BI when performing row-level lookups across related datasets, especially in scenarios where relationships are not explicitly defined in the model.

         

        please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

         

        Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin ,

     

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

     

    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi @Syndicate_Admin ,

     

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

     

    Thank you.