Forum Discussion
CongPham
6 years agoHelper I
Help to Calculate target column base on Source Column and Target Column itself
Hi all, I have some problem and dont know how to write DAX to get value at Target Column (pleass see the picture) Anyone can help me to slove this? Many thanks!
- 6 years ago
Hi CongPham ,
You could use POWER() function and SUMX() function to do it.
You need two measures:
Power = VAR a = CALCULATE ( MAX ( 'Table'[No] ), ALLSELECTED ( 'Table' ) ) RETURN POWER ( 0.25, a - SELECTEDVALUE ( 'Table'[No] ) ) * SELECTEDVALUE ( 'Table'[Value] )Target = VAR a = CALCULATE ( MAX ( 'Table'[No] ) ) RETURN ROUND ( 0.75 * SUMX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[No] <= MAX ( 'Table'[No] ) ), [Power] ) + POWER ( 0.25, a ) * 466, 0 )Here is my result.
- 6 years ago
Hi CongPham ,
The trick is to find the regulation and establish a general formula. Please refer to the following image:
v-eachen-msft
6 years agoCommunity Support
Hi CongPham ,
You could use POWER() function and SUMX() function to do it.
You need two measures:
Power =
VAR a =
CALCULATE ( MAX ( 'Table'[No] ), ALLSELECTED ( 'Table' ) )
RETURN
POWER ( 0.25, a - SELECTEDVALUE ( 'Table'[No] ) )
* SELECTEDVALUE ( 'Table'[Value] )Target =
VAR a =
CALCULATE ( MAX ( 'Table'[No] ) )
RETURN
ROUND (
0.75
* SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[No] <= MAX ( 'Table'[No] ) ),
[Power]
)
+ POWER ( 0.25, a ) * 466,
0
)
Here is my result.
CongPham
6 years agoHelper I
v-eachen-msft Many many thank
I got the true value I need, but I still don't understand your formula's meaning.
Could you give some advice?
- v-eachen-msft6 years agoCommunity Support
Hi CongPham ,
The trick is to find the regulation and establish a general formula. Please refer to the following image: