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
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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


Anonymous
Not applicable

You are a great.

Anonymous
Not applicable

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.

Top Solution Authors