Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NOVICE02
Helper III
Helper III

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 month , it will show the activated cohort first and then the other months will represent the volumes that cancelled. this is the layout that is needed

 

What i want to do is show the Cancel % over the activated volume grouped by month

 

is this possible?

 

so 20-nov = 308/7328

20 dec = 190/7328

 

and so on

 

monthColumn_monthCancelled_volumeCancel %
202011Activated7328 
20201120-Nov3084%
20201120-Dec1903%
20201121-Jan831%
20201121-Feb541%
20201121-Mar1452%
20201121-Apr1021%
20201121-May90%
20201121-Jun90%
20201121-Jul30%
20201121-Aug561%
20201121-Sep511%
20201121-Oct491%
20201121-Nov90%
20201121-Dec40%
202012Activated636 
20201220-Dec30.5%
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

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:

VahidDM_0-1642376340079.png

 

 

 

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/

 

 

View solution in original post

2 REPLIES 2
NOVICE02
Helper III
Helper III

Thank you so much Vahid. This is exactly what i needed 🙂

VahidDM
Super User
Super User

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:

VahidDM_0-1642376340079.png

 

 

 

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/

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.