Reply
Frequent Visitor
Posts: 6
Registered: ‎08-29-2018
Accepted Solution

Need help with column calculation

[ Edited ]

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.


 Power BI capture.JPG

Accepted Solutions
New Contributor
Posts: 420
Registered: ‎04-14-2018

Re: Need help with column calculation

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

View solution in original post

Community Support Team
Posts: 1,332
Registered: ‎07-30-2018

Re: Need help with column calculation

HI, @Nilanka

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

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

View solution in original post


All Replies
Established Member
Posts: 196
Registered: ‎05-03-2017

Re: Need help with column calculation

[ Edited ]

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)

 

New Contributor
Posts: 420
Registered: ‎04-14-2018

Re: Need help with column calculation

You can also use an if statement:

 

Measure = IF([Currency] = "EUR", 9.54 * [Package_Price], IF([Currency] = "DKK", 1.28 * [Package_Price], [Package_Price]))
Highlighted
Established Member
Posts: 201
Registered: ‎07-12-2017

Re: Need help with column calculation

Hi @Nilanka

 

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)

exchgRate.gifExchange Rate

 

 

 

 

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

 

Regards,

Affan

Frequent Visitor
Posts: 6
Registered: ‎08-29-2018

Re: Need help with column calculation

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

 

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

Established Member
Posts: 201
Registered: ‎07-12-2017

Re: Need help with column calculation

Which solution have you tried from the above ones?
Community Support Team
Posts: 1,332
Registered: ‎07-30-2018

Re: Need help with column calculation

HI, @Nilanka

Try this formula to add a calculate column

New Package Price = 
IF (
    [Currency] = "EUR",
    9.54 * [Package Price],
    IF (
        [Currency] = "DKK",
        1.28 * [Package Price],
        IF ( [Currency] = "NOK", [Package Price] )
    )
)

16

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Frequent Visitor
Posts: 6
Registered: ‎08-29-2018

Re: Need help with column calculation

Currently trying all , but struggling to get the outcome I want. Will be trying it again , i must have made a mistake somewhere

Frequent Visitor
Posts: 6
Registered: ‎08-29-2018

Re: Need help with column calculation

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

 

Capture power bo.JPG

New Contributor
Posts: 420
Registered: ‎04-14-2018

Re: Need help with column calculation

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