Forum Discussion

GraceTCL's avatar
GraceTCL
Icon for Helper II rankHelper II
5 years ago
Solved

Convert currency

Hi I need to convert the local currency to reporting currency. In the exchange rate dimension table, the date reference is based on start or end date of the month while my fact table is based on cal...
  • Jihwan_Kim's avatar
    Jihwan_Kim
    5 years ago

    Hi, GraceTCL 

    Thank you for sharing the data.

     

    - sorry to say that I could not use the date-id column effectively because my computer generally uses mm/dd/yyyy format. And, it is quite easy for me to create an effective measure when using the actual date column, instead of using date_id column in number format.

    - I disconnected one relationship. please check the below picture and the sample pbix file's link down below.

     

     

    Renue Exchange rate apply =
    SUMX (
    VALUES ( 'Calendar'[Date] ),
    CALCULATE (
    SUMX (
    'Food Metrics',
    'Food Metrics'[Revenue_LC]
    * CALCULATE (
    SELECTEDVALUE ( 'Exchange rate'[Exchange rate] ),
    FILTER (
    'Exchange rate',
    MIN ( 'Calendar'[Date] ) >= 'Exchange rate'[Start Date]
    && MAX ( 'Calendar'[Date] ) <= 'Exchange rate'[End Date]
    )
    )
    )
    )
    )
     
     
     

    Hi, My name is Jihwan Kim.


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


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM