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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Direct & indirect Commodity

Hello Expert,

I want to show 2 bar of commoditry:
- Fisrt Bar: shows commodity that have amount when ( coontry of Import = country of Origin).

- Second Bar: shows commodity that have amount when ( coontry of Import dose Not equal to country of Origin).

 

Thank You. 

 

 

Country of Origin Country  of Import CommodityPoint of EntryAmount 
ChinaChinaMultiple LoudspeakersSarfayt Land Border34
ChinaUAEBall BearingsSOHAR (SEA PORT)3445
UAEUAEMultiple LoudspeakersAl Wajajah Land Border5676
ChinaChinaMultiple LoudspeakersCustoms HQ6768
ChinaUAESkulcaps (Taqias)HAFEET (BORDER  POST)342
UAEKSASkulcaps (Taqias)Sarfayt Land Border132
ChinaUAEDress PatternsKHATMAT MILAHA (BORDER  POST)323
TurkeyUAESkulcaps (Taqias)Al Darah234
ChinaRussiaSkulcaps (Taqias)Al Wajajah Land Border4545
ChinaIndiaDress PatternsSUWEIQ (SEA PORT)76
TurkeyTurkeyBall BearingsAL DUQM (SEA PORT)545
KSAOmanDress PatternsSARFAIT (BORDER POST)450
KSAKSAMultiple LoudspeakersCENTRAL POST OFFICE164
KSAJapanDress PatternsSalalah International Airport Passenger247
KSAKSAMultiple LoudspeakersDIBA PORT (BORDER POST)384
KSAIndiaDress PatternsAl Darah109
USAUSABall BearingsDIRECTORATE GENERA263
USABrazilDress PatternsSarfayt Land Border305
USACanadaFuel oils For shipsARKAN SOHAR LOGISTICS LLC NORTH486
USAUSABall BearingsHAFEET (BORDER  POST)417
USAUSABall BearingsARKAN SOHAR LOGISTICS LLC NORTH433
USAEgyptFuel oils For shipsDIBA PORT (BORDER POST)334
USAIraqFuel oils For shipsSarfayt Land Border209
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, 

Please check the below measures and the attached pbix file whether it suits your requirement.

 

Amount orging import same: = 
VAR _newtable =
    FILTER (
        ADDCOLUMNS (
            Data,
            "@origin", CALCULATE ( MAX ( Data[Country of Origin] ) ),
            "@import", CALCULATE ( MAX ( Data[Country  of Import] ) )
        ),
        [@origin] = [@import]
    )
RETURN
    SUMX ( _newtable, Data[Amount] )

 

Amount orging import diff: = 
VAR _newtable =
    FILTER (
        ADDCOLUMNS (
            Data,
            "@origin", CALCULATE ( MAX ( Data[Country of Origin] ) ),
            "@import", CALCULATE ( MAX ( Data[Country  of Import] ) )
        ),
        [@origin] <> [@import]
    )
RETURN
    SUMX ( _newtable, Data[Amount] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, 

Please check the below measures and the attached pbix file whether it suits your requirement.

 

Amount orging import same: = 
VAR _newtable =
    FILTER (
        ADDCOLUMNS (
            Data,
            "@origin", CALCULATE ( MAX ( Data[Country of Origin] ) ),
            "@import", CALCULATE ( MAX ( Data[Country  of Import] ) )
        ),
        [@origin] = [@import]
    )
RETURN
    SUMX ( _newtable, Data[Amount] )

 

Amount orging import diff: = 
VAR _newtable =
    FILTER (
        ADDCOLUMNS (
            Data,
            "@origin", CALCULATE ( MAX ( Data[Country of Origin] ) ),
            "@import", CALCULATE ( MAX ( Data[Country  of Import] ) )
        ),
        [@origin] <> [@import]
    )
RETURN
    SUMX ( _newtable, Data[Amount] )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

You are a great.

Anonymous
Not applicable

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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