Forum Discussion

jackj's avatar
jackj
Helper I
5 years ago
Solved

Create a fixed denominator

I'm struggling with a fairly straightforward issue and would love some assistance...

 

I have a matrix that contains the following, based on a table of order details that includes userID, date, and $ amount:

 

Rows = [First Purchase Week], a calculated column that looks for the first date of purchase for each userID.

Columns = [Week End], a calculated column that looks for the week ending that corresponds with each order date.

Values = [Count of UserID], a measure. "Count of UserID = DISTINCTCOUNT('warehouse OrderDetails'[UserID])"

 

The matrix displays values exactly as I would want them to appear.

 

What I would like to do, however, is fix the denominator of the values of the first purchase week, and use this total as the basis for cohort based analysis.  Literally dividing the results of each subsequent week, one by one, by the first week.  Below is a screenshot of the matrix

 

 

For example, I want to be able to calculate each week of the group whose first visit was 4/3/2021 (19 users), and show the percentage of them that returned each week - 19/19 in week 1, 13/19 in week 2, 4/19 in week 3, etc.

 

How can I do this?

 

Thanks in advance for any help here.

  • Hi,

    This measure seems to work

    Measure 2 = DIVIDE([Count of UserID],CALCULATE([Count of UserID],ALL('warehouse OrderDetails'[Week End])))

    Hope this helps.

7 Replies