Forum Discussion
Multiply with difference columns based on a value
- 5 years ago
I have made a calculated column in the Power BI level. If you want to make this in Power Query then write the code like this..
The result will be something like this..
like this!
Try to unpivot the year columns in Power Query level. After unpivoting the table will look like this..
Then in Power BI try to create a calculated column like this:
Column =
IF (
SELECTEDVALUE ( 'Table'[Duration] ) = SELECTEDVALUE ( 'Table'[Year] ),
'Table'[Commission Amount] * 'Table'[Exchange Rate] * 'Table'[Values],
0
)
which will give you the result...
If this helps, kindly mark this as a solution. Appreciate with Kuddos. Thank You..
- Anonymous5 years agoNot applicable
Thank you so much for your help! But I can't use IF in the formula...
- Angith_Nair5 years agoContinued Contributor
I have made a calculated column in the Power BI level. If you want to make this in Power Query then write the code like this..
The result will be something like this..
- Anonymous5 years agoNot applicable
Hi sorry, can I have one more question?
As I was merged table for the exchange rate which have few months data when I unpivot the year the result will calculated all months of exchange rate for 1 case but I only want when 1 case appear then calculate the correct formula [amount * exchange rate * value].
I don't know do you understand me....haha....but thanks anyway!
- Anonymous5 years agoNot applicable
That's work! Really thankssss!!!