Forum Discussion

ifenek's avatar
ifenek
Frequent Visitor
5 years ago
Solved

Need help dealing with multiple currency and converting them

Hello,    I can't get my head around on how to do this so i'm coming here for help.    I have a column homenett holding all my values. The problem they come from differente databases and therefor...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi ifenek 

    I think your currid: CAN in VW_Currency Table should be CAD, or we can't find CAD in VW_Currency Table.

    You can achieve your goal by measure.

    Measure:

    Measure = 
    VAR _SelectID =
        SELECTEDVALUE ( VW_Currency[currid] )
    VAR _PerRate =
        SUMX (
            FILTER (
                ALL ( VW_Currency ),
                VW_Currency[currid] = MAX ( VW_Orders[CurrencyID] )
            ),
            VW_Currency[currate]
        )
    VAR _SelRate =
        SUMX (
            FILTER ( ALL ( VW_Currency ), VW_Currency[currid] = _SelectID ),
            VW_Currency[currate]
        )
    VAR _GBPhomenett =
        DIVIDE ( SUM ( VW_Orders[homenett] ), _PerRate )
    VAR _Selhomenett =
        DIVIDE ( SUM ( VW_Orders[homenett] ), _PerRate ) * _SelRate
    RETURN
        IF ( ISFILTERED ( VW_Currency[curdesc] ), _Selhomenett, _GBPhomenett )
    M.homenett = SUMX(VW_Orders,[Measure])

    Build a measure to show the currency format.

    Currency = 
    IF(ISFILTERED(VW_Currency[curdesc]),SELECTEDVALUE(VW_Currency[curdesc]),"GBP")

    Result is as below.

    By default if the slicer is unfiltered, it will show homenett in GBP.

    Select USD.

    You can download the pbix file from this link: Sample

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.