Forum Discussion

NOVICE02's avatar
NOVICE02
Icon for Helper III rankHelper III
4 years ago
Solved

Divide value by another in same column - for cohort analysis

Hi all,   I have aggregated data for cohort analysis ( as the transactional layer is too large) and it looks like below. I aggregated using sql in a way so that visually when i apply the column mon...
  • VahidDM's avatar
    4 years ago

    Hi NOVICE02 

     

    Try this code to add a new column to your table:

    Cancel% = 
    VAR _Ac =
        CALCULATE (
            MAX ( 'Table'[Cancelled_volume] ),
            FILTER ( ALL ( 'Table' ), 'Table'[month] = EARLIER ( 'Table'[month] ) )
        )
    RETURN
        IF ( 'Table'[Column_month] = "Activated", BLANK (), [Cancelled_volume] / _Ac )

     

     

    output:

     

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/