Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Finding mutual values for two columns visualized in a table

Dear,

 

I just started with PowerBI after an exstensive period making use of MS Excel.

I am currently making a dashboard from logistic perspective for my company. 

My aim is to create a visual which shows mutual destinations and origins per carrier for respectively export and import incl. count of shipments.

It must look like below.

 

Example:

 

If value in Column Destination and Column Origin is equal then this mutual value must be displayed as in below table incl. count of shipment numbers for Destination (Export) and Origin (Import). 

 

Carrier X

Shared destination/originExportImport

USA (mutual destination & origin)

10050
Mexico (mutual destination & origin)4010
France (mutual destination & origin)205

 

How do I need to arrange/model my data in order to achieve this? (helping columns, formulas)

 

Thank you in advance for the responses.

 

KR Robert

4 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

     

    Can you share some sample data in table format to show what you have in the original table? How do you count the numbers for Destination (Export) and Origin (Import) based on that table? I guess probably there are Destination and Origin columns in the table, but I don't know how to get the count you want with only these two columns. There must be some other columns and logics to help the calculation.  

     

    Best Regards,
    Community Support Team _ Jing

    • Anonymous's avatar
      Anonymous
      Not applicable

      I have simulated this situation in MS Excel making use of Input and Ouput table below. 

      Input table: is a pivot table

      Output table: normal table

       

      In Excel I created a formula which seeks mutual countries with following formula:
      =IFERROR(UNIQUE(FILTER([ImportColumnTable1];ISNUMBER(XLOOKUP([ImportColumnTable1];ExportColumnTable1];0))));"")

       

      This formula results in table below:

       

      Mutual
      Mexico
      India
      Malaysia

       

      With a vlookup I search the corresponding count of shipments from Pivot table which results in Output table.

       

      Input table (Pivot table)

      ImportCount of shipmentsExportCount of shipments
      China27United states8
      Turkey13Mexico6
      Mexico4Venezuela3
      India3Congo (Kinshasa)1
      South Korea3Oman1
      Malaysia2India1
      Morocco2Canada1
      Chile1Malaysia1
      Thailand1  

       

      Output table (normal table)

      MutualIMEX
      Mexico46
      India31
      Malaysia21
      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        So you wish to create a 3 column table with only those countries showing which are present in the Import and Export columns.  If my understaning is correct, then share the actual data (not the Pivot Table).