'how to create a new column with adding fixed value to another column cell value

I have a table looks like this

enter image description here

I have to create a new column C, with 1st value is the same as column B and next value should add a fix value 20 to each cell, how can I do this?

Output should look like this:

enter image description here

It will be a great help if someone can help me with this, thanks



Solution 1:[1]

You can just make it by saying:

C = ( [A] - 1 ) * 20 + 100

Alternative if you have a different value in [B] you can use the LOOKUPVALUE function and it'd look like this:

C = ( [A] - 1 ) * 20 + LOOKUPVALUE( Table[B], [B], MAX( [B] ) )

Solution 2:[2]

I'm not entirely sure what you're after but I'm guessing it's with random values in B and calculations based on that. If that's what you're talking about this should work:

C = 
IF(
    [B] = BLANK(), 
    LOOKUPVALUE( 
        'Table'[B], 
        'Table'[A], 
        CALCULATE( 
            LASTNONBLANK( 'Table'[A], 1),
            FILTER(
                'Table',
                'Table'[A] <= EARLIER( 'Table'[A] )
                    && not ISBLANK( 'Table'[B] )
            ) 
        ) 
    ) +
    ( [A] - CALCULATE(
        LASTNONBLANK('Table'[A], 1),
        FILTER(
            'Table',
            'Table'[A] <= EARLIER( 'Table'[A] )
                && not ISBLANK( 'Table'[B] )
        )
    ) ) * 20,
    [B]
)

This is what an example would look like:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2