Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Need help with column calculation

I have two columns Package price and Currency. In the Currency column i have 3 difference currencies present NOK , DKK and EUR.

I want the DKK  values from Package price  to multiplied by 1.28 and EUR to be multipled by 9.54 and NOK remain same.

So I want to create one column with total NOK price.  

Bit confused how to do this.


 
  • Anonymous's avatar
    Anonymous
    7 years ago

    I am still not able to calculate it this is the error i get

     

  • Change the last VoucherLog[Currency] to VoucherLog[Package Price]

  • HI, Anonymous

    There is a mistabke in your formula

    Column = IF(VoucherLog[Currency]="Eur",9.54*VoucherLog[Package Price],IF(VoucherLog[Currency]="DKK",1.28*VoucherLog[Package Price],IF(VoucherLog[Currency]="NOK",VoucherLog[Currency])))
     
    Column = IF(VoucherLog[Currency]="Eur",9.54*VoucherLog[Package Price],IF(VoucherLog[Currency]="DKK",1.28*VoucherLog[Package Price],IF(VoucherLog[Currency]="NOK",VoucherLog[Package Price])))
     
    Note: Black body part

     

    Best Regards,

    Lin

10 Replies

  • Omega's avatar
    Omega
    Impactful Individual

    You can create the similar measure/Column using the below DAX:

     

     

    Package Price New = Switch (True(), Currency = "DKK", Package Price*1.28, "EUR", Package price*9,54, Package Price)

     

  • themistoklis's avatar
    themistoklis
    Community Champion

    You can also use an if statement:

     

    Measure = IF([Currency] = "EUR", 9.54 * [Package_Price], IF([Currency] = "DKK", 1.28 * [Package_Price], [Package_Price]))
    • Anonymous's avatar
      Anonymous
      Not applicable

      "Operator or expression '( )' is not supported in this context."

       

      i got this as a reply , what is my mistake here

      • affan's avatar
        affan
        Solution Sage
        Which solution have you tried from the above ones?
  • affan's avatar
    affan
    Solution Sage

    Hi Anonymous

     

    You can also acheive this by using Power Query.

     

    = Table.AddColumn(#"Changed Type", "ExchangeRate", each if [Currency] = "NOK" then 1 else if [Currency] = "DKK" then 1.28 else if [Currency] = "EUR" then 9.45 else null, type number)

    Exchange Rate

     

     

     

     

    If this helped you, please mark this post as an accepted solution and like to give KUDOS .

     

    Regards,

    Affan