Forum Discussion

byfighting's avatar
byfighting
New Member
6 years ago
Solved

Calculate Growth %

Hi All,

 

I want to calculate growth % off of Mar revenue. How can I achieve the results in column C in Power BI? Thank you!

 

 

  • Hi byfighting ,

    You can create this calculated column:

    Column =
    VAR _min =
        CALCULATE (
            SUM ( 'Table'[Revenue] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Date] = MIN ( 'Table'[Date] ) )
        )
    VAR result = ( [Revenue] - _min ) / _min
    RETURN
        IF ( result <> 0, result, BLANK () )
    

    Attached a sample file in the below, hopes to help you.

     

    Best Regards,
    Yingjie Li

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi byfighting 

     

    Calculated Column =
    VAR PreviousRow =
        TOPN (
            1,
            FILTER (
                Table1,
                Table1[Date] < EARLIER (Table1[Date])  //  try '>'  if '<' donesn't give you the desires result
            ),
            [Date], DESC
        )
    VAR PreviousValue =
        MINX ( PreviousRow, [revenew] )
    RETURN
        ([revenew] - PreviousValue)/PreviousValue   //returns number
    //If you need the percentage from Revenew then RETURN ([revenew] - PreviousValue)/[revenew]

    OR

    Calculated Column =
    VAR PreviousRow =
        TOPN (
            1,
            FILTER (
                Table1,
                Table1[Date] < EARLIER (Table1[Date])  //  try '>'  if '<' donesn't give you the desires result
            ),
            [Date], DESC
        )
    VAR PreviousValue =
        MINX ( PreviousRow, [revenew] )
    Var G = 
       IF(PreviousValue = 0,"", CONVERT(FORMAT(([revenew] - PreviousValue)/PreviousValue,"0#.00%"),STRING))
    return G //returns string

     

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi byfighting ,

    You can create this calculated column:

    Column =
    VAR _min =
        CALCULATE (
            SUM ( 'Table'[Revenue] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Date] = MIN ( 'Table'[Date] ) )
        )
    VAR result = ( [Revenue] - _min ) / _min
    RETURN
        IF ( result <> 0, result, BLANK () )
    

    Attached a sample file in the below, hopes to help you.

     

    Best Regards,
    Yingjie Li

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.