Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Need help on Currency conversion

Hi,

 

I have table like below in that need to convert currency based on country.

 

Country_nameCurrencyCurrency in country_nameto usd
TaiwanTWD400 
Greater china areaHKD500 
Greater china areaCNY600 

 

I need a m-query/dax expression to convert above country currency to usd.

can someone help me please.

Thanks in advance

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Please follow these steps:

    1.Create a table for the dollar exchange rate: Table (2).

    2.Create a link between the two tables.

    3.Create metrics and convert them based on the current month's exchange rate.

     

     

    Measure =
    
    var _rate = MAXX(
    
        FILTER(ALL('Table (2)'),MONTH(TODAY())=MONTH('Table (2)'[Month])&&YEAR(TODAY())=YEAR('Table (2)'[Month])),
    
        'Table (2)'[Dollar exchange rate])
    
    return
    
    CALCULATE(MAX('Table'[Quantities]) * _rate)

     

     

    4.The results are shown below.

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

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

4 Replies

  • Hi Anonymous 

    You will need  a separate table that contains the conversion factor for its currency.  The formula to access the conversion rate depends on whether there is just one conversion for each currency (no separate ones for each month) and then divide or multiply the local currency amount by the conversion factor.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please follow these steps:

    1.Create a table for the dollar exchange rate: Table (2).

    2.Create a link between the two tables.

    3.Create metrics and convert them based on the current month's exchange rate.

     

     

    Measure =
    
    var _rate = MAXX(
    
        FILTER(ALL('Table (2)'),MONTH(TODAY())=MONTH('Table (2)'[Month])&&YEAR(TODAY())=YEAR('Table (2)'[Month])),
    
        'Table (2)'[Dollar exchange rate])
    
    return
    
    CALCULATE(MAX('Table'[Quantities]) * _rate)

     

     

    4.The results are shown below.

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

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

  • Hi Anonymous ,
    You can follow this youtube video , this quite similar to your usecase :-
    https://www.youtube.com/watch?v=IDJ05Zp3Gvo
    Hope this is helpful.
    Thanks,
    Pratyasha Samal
    Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
    If you found this post helpful, please give Kudos C