Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
film20j
Frequent Visitor

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 2
v-chuncz-msft
Community Support
Community Support

@film20j,

 

Just add a calculated column.

Column =
LEFT ( Table1[State 1], 1 ) = LEFT ( Table1[State 2], 1 )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.