I've got a really weird situation that I can't explain and must be something to do with context. I have created a new measure, but the total of the rows does not equal the grand total. I am sure the grand total is correct so for some reason the rows are not always showing a value when they should do. It looks like this and the last column is my new measure
[TABLE="width: 500"]
<tbody>[TR]
[TD]
<tbody>
[TD="class: xl381"]1111243[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1226023[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1243663[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1244363[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="class: xl381"]1244623[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1244783[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1244943[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1245193[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="class: xl381"]Grand Total[/TD]
[TD="class: xl382, align: right"]8[/TD]
[TD="align: right"]3[/TD]
</tbody>[/TD]
[/TR]
</tbody>[/TABLE]
I have 2 tables "Users" and "Transactions" where USER ID is the related field. Activation Day is the day the user first buys, transactions[date] is the date of buying. I want to count which of the users buy again 14 to 44 days later. The table above is filter for just one activation day which is 15/4/14. My measure is
</max(transactions[date])
I think i am creating a table of related transactions for my 8 users where the transaction date falls more than 14 and less than 44 days after this activation date and they are spending. I then calculate the distinct users in this table. The last part is to only do this calculation on users who activated at least 44 days ago.
To check what the result should be I ran this pivot for these 8 users to find the days they bought on. The window should be 29/4 to 29/5. So you can see that user 1244943 bought on 2/5 and should show a 1 for my measure but it is blank. However the total is correct as 3. I have test several other days with similar results.
[TABLE="width: 500"]
<tbody>[TR]
[TD]
<tbody>
Transaction [date]
[TD="width: 65"][/TD]
[TD="width: 65"][/TD]
[TD="width: 65"][/TD]
[TD="width: 65"][/TD]
[TD="class: xl382, align: right"]15/04/2014[/TD]
[TD="class: xl382, align: right"]27/04/2014[/TD]
[TD="class: xl382, align: right"]02/05/2014[/TD]
[TD="class: xl382, align: right"]15/05/2014[/TD]
[TD="class: xl382, align: right"]26/05/2014[/TD]
[TD="class: xl383"]1111243[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1226023[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1243663[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244363[/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244623[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244783[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244943[/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1245193[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384, align: right"]2[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl383"]Grand Total[/TD]
[TD="class: xl384, align: right"]16[/TD]
[TD="class: xl384, align: right"]2[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384, align: right"]1[/TD]
</tbody>[/TD]
[/TR]
</tbody>[/TABLE]
I just cannot understand how the total is NOT the sum of the rows? If anyone can shed any light light i would really appreciate as hard to trust the output. I'm using Excel 2013
P.S. When I preview the code is not complete so this may not come out right!
mike
</transactions[date]>
[TABLE="width: 500"]
<tbody>[TR]
[TD]
User ID | Activated Users | Spend Users 14-44 Days |
<tbody>
[TD="class: xl381"]1111243[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1226023[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1243663[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1244363[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="class: xl381"]1244623[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1244783[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1244943[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="class: xl381"]1245193[/TD]
[TD="class: xl382, align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="class: xl381"]Grand Total[/TD]
[TD="class: xl382, align: right"]8[/TD]
[TD="align: right"]3[/TD]
</tbody>
[/TR]
</tbody>[/TABLE]
I have 2 tables "Users" and "Transactions" where USER ID is the related field. Activation Day is the day the user first buys, transactions[date] is the date of buying. I want to count which of the users buy again 14 to 44 days later. The table above is filter for just one activation day which is 15/4/14. My measure is
Code:
CALCULATE(
CALCULATE(DISTINCTCOUNT(transactions[User ID]),
FILTER(RELATEDTABLE(transactions),
RELATED(Users[Activation Day])+14<transactions[date] &&
< transactions[Date] &&
RELATED(users[Activation Day])+44 > transactions[Date] &&
transactions[Transaction]="spend"
)
),
FILTER(
users,
users[1st Spend]+44<max(transactions[date])
< max(transactions[Date])
)
)
I think i am creating a table of related transactions for my 8 users where the transaction date falls more than 14 and less than 44 days after this activation date and they are spending. I then calculate the distinct users in this table. The last part is to only do this calculation on users who activated at least 44 days ago.
To check what the result should be I ran this pivot for these 8 users to find the days they bought on. The window should be 29/4 to 29/5. So you can see that user 1244943 bought on 2/5 and should show a 1 for my measure but it is blank. However the total is correct as 3. I have test several other days with similar results.
[TABLE="width: 500"]
<tbody>[TR]
[TD]
Purchases |
User ID |
<tbody>
Transaction [date]
[TD="width: 65"][/TD]
[TD="width: 65"][/TD]
[TD="width: 65"][/TD]
[TD="width: 65"][/TD]
[TD="class: xl382, align: right"]15/04/2014[/TD]
[TD="class: xl382, align: right"]27/04/2014[/TD]
[TD="class: xl382, align: right"]02/05/2014[/TD]
[TD="class: xl382, align: right"]15/05/2014[/TD]
[TD="class: xl382, align: right"]26/05/2014[/TD]
[TD="class: xl383"]1111243[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1226023[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1243663[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244363[/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244623[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244783[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1244943[/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl383"]1245193[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384, align: right"]2[/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384"][/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl383"]Grand Total[/TD]
[TD="class: xl384, align: right"]16[/TD]
[TD="class: xl384, align: right"]2[/TD]
[TD="class: xl384, align: right"]1[/TD]
[TD="class: xl384, align: right"]5[/TD]
[TD="class: xl384, align: right"]1[/TD]
</tbody>
[/TR]
</tbody>[/TABLE]
I just cannot understand how the total is NOT the sum of the rows? If anyone can shed any light light i would really appreciate as hard to trust the output. I'm using Excel 2013
P.S. When I preview the code is not complete so this may not come out right!
mike
</transactions[date]>