Forum Discussion
Help with Dax measure/calculated column
Hi! I need help with creating Dax measure/calculated column. In Column "Value" first row is always 100. Other rows are calculated the following way: The value from the previous row * rate of the curren row + 100. The example is in the attachement.
Hi , Anonymous
According to your description, you can try calculated column as below after creating a index:
Value = VAR m = [Index] RETURN 100 * ( SUMX ( FILTER ( 'Table', [Index] >= 2 && [Index] <= m ), VAR i = [Index] VAR t = FILTER ( ALL ( 'Table' ), [Index] >= i && [Index] <= m ) RETURN CALCULATE ( PRODUCTX ( t, [Rate] ) ) ) + CALCULATE ( VALUES ( 'Table'[Rate] ), FILTER(ALL('Table'),'Table'[Index] = 1 ) ))Here is a sample :
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- v-easonf-msft
Community Support
Hi , Anonymous
According to your description, you can try calculated column as below after creating a index:
Value = VAR m = [Index] RETURN 100 * ( SUMX ( FILTER ( 'Table', [Index] >= 2 && [Index] <= m ), VAR i = [Index] VAR t = FILTER ( ALL ( 'Table' ), [Index] >= i && [Index] <= m ) RETURN CALCULATE ( PRODUCTX ( t, [Rate] ) ) ) + CALCULATE ( VALUES ( 'Table'[Rate] ), FILTER(ALL('Table'),'Table'[Index] = 1 ) ))Here is a sample :
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
It worked! Thank you!