Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Exchange Rate total is wrong

hey there.

I have a table of sales with different currencies, and I made a measure to convert the sales to my desired currency.

the issue is when I view the total it's not correct and I have no idea why.

here is the sales table:

here is the total, which is wrong

here is the measure that calculates the currency exchange

the currency table is just a table that gives me the exchange rate for my currency.

Revenue in SAR = 
VAR    
    _currency= MAX('Backend Revenue'[Currency])
VAR
    _cinversionRate= 
        CALCULATE(
            MAX('Currency'[SAR per unit])
            , 'Currency'[Currency]=_currency
        )
VAR
    _unitPriceSAR=
         SUM('Backend Revenue'[Value])* _cinversionRate 
RETURN
    _unitPriceSAR  

 

 

 

7 Replies

  • Hi,

    I do not know how your semantic model looks like, but please try something like below whether it suits your requirement.

     

    Revenue in SAR =
    VAR _unitPriceSAR =
        SUMX (
            VALUES ( 'Currency'[Currency] ),
            CALCULATE ( SUM ( 'Backend Revenue'[Value] ) )
                * CALCULATE (
                    MAX ( 'Currency'[SAR per unit] ),
                    'Currency'[Currency] = MAX ( 'Backend Revenue'[Currency] )
                )
        )
    RETURN
        _unitPriceSAR
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      same thing

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super User

        Hi,

        Please share your sample pbix file's link, and then I can try to look into it.