Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • Jihwan_Kim's avatar
    4 years ago

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