cancel
Showing results for 
Search instead for 
Did you mean: 
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]))



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

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]))



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors