Forum Discussion

film20j's avatar
film20j
Frequent Visitor
8 years ago

How to calculate a table with only transactions between countries(and not within country or state)

I am trying to find a way to separate trades between 2 countries and exclude trade with a country

Lets say I have countrues A , B and C

within each countries there are states AA, AB, .... CA , CB, ....

 

State 1     State 2     Quantity

All transactions
AAAA0.1
ABAB0.2
ACAB0.15
ADCC0.3
AECE0.05
BBBC0.01
BCBB0.2
BDAB0.3
CACA0.2
CBCA0.5
CCBB0.2
CDBB0.1
CEBB0.05
CFCA0
CGAA0.2
CHAB0.15

 

My table above has all the transactions

The trasactions i want to keep are the the ones between countries 

 

State 1 State 2 Quantity

Transactions between countries
ADCC0.3
AECE0.05
BDAB0.3
CCBB0.2
CDBB0.1
CEBB0.05
CGAA0.2
CHAB0.15

 

2 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Icon for Community Support rankCommunity Support

    film20j,

     

    Just add a calculated column.

    Column =
    LEFT ( Table1[State 1], 1 ) = LEFT ( Table1[State 2], 1 )
    
    • film20j's avatar
      film20j
      Frequent Visitor

      That would work indeed if countries where really named A, B, C, ....  :(