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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Calculate Direct & Undirect Amount

Hello Experts, 
I want to calculate 2 measures for Direct & undirect Amount using data attached to show this value in table chart to each country whats the direct and indirect;
- Direct: Country of Origin and Country of Import are the same,
- Indirect: Country of Origin is NOT equal Country of Import. 
For Example using UAE Country:   - Direct: Country of Origin & Country of Import = UAE

                                                       -Indirect: Country of Origin = UAE, Country of Import <> UAE
UAE is an example, but I want to show all country of imports in a table chart to see the direct and indirect for each country.
Thanls in Advamced.

Country of Origin Country  of Import CommodityPoint of EntryAmount 
ChinaChinaMultiple LoudspeakersSarfayt Land Border34
ChinaUAENatural Gas, LiquefiedSOHAR (SEA PORT)3445
UAEUAEBall BearingsAl Wajajah Land Border5676
ChinaChinaElectric DoorbellsCustoms HQ6768
ChinaUAETableware Or KitchenwareHAFEET (BORDER  POST)342
UAEKSAParts Of Gas Turbines, N.E.S.Sarfayt Land Border132
ChinaUAEMultiple LoudspeakersKHATMAT MILAHA (BORDER  POST)323
TurkeyUAESkulcaps (Taqias)Al Darah234
ChinaRussiaAudio-Frequency Electric AmplifiersAl Wajajah Land Border4545
ChinaIndiaDress PatternsSUWEIQ (SEA PORT)76
TurkeyTurkeyInductors, N.E.SAL DUQM (SEA PORT)545
KSAOmanMotors Of An Output <= 37,5 WSARFAIT (BORDER POST)386
KSAKSAMultiple LoudspeakersCENTRAL POST OFFICE217
KSAJapanElectric DoorbellsSalalah International Airport Passenger463
KSAKSANatural Gas, LiquefiedDIBA PORT (BORDER POST)288
KSAIndiaFuel oils For shipsAl Darah360
USAUSAFrozen Cuttle fish and squidDIRECTORATE GENERA128
USABrazilDress PatternsSarfayt Land Border190
USACanadaAudio-Frequency Electric AmplifiersARKAN SOHAR LOGISTICS LLC NORTH354
USAUSASweet Biscuits  HAFEET (BORDER  POST)300
USAUSAHair Lacquers  ARKAN SOHAR LOGISTICS LLC NORTH142
USAEgyptHousehold Ware Of ZincDIBA PORT (BORDER POST)188
USAIraqSweet Biscuits  Sarfayt Land Border149
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can try two measures like

 

Direct =Calculate(Sum(Table[Amount]), filter(Table, Table[Country of Origin] = Table[Country of Import]))

 

 

In Direct = Calculate(Sum(Table[Amount]), filter(Table, Table[Country of Origin] <> Table[Country of Import]))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , You can try two measures like

 

Direct =Calculate(Sum(Table[Amount]), filter(Table, Table[Country of Origin] = Table[Country of Import]))

 

 

In Direct = Calculate(Sum(Table[Amount]), filter(Table, Table[Country of Origin] <> Table[Country of Import]))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors