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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.