Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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.

 

 

2 Replies

  • v-easonf-msft's avatar
    v-easonf-msft
    Icon for Community Support rankCommunity 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 :

    URL: https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/EeRW33d2a0NMgZXo3yJhwYMBMI2oCGW9stq8HfdNHV8U-g?e=LaCV05

     

    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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      It worked! Thank you!