Forum Discussion
shanipowerbi
Helper III
6 years agoHow to Calculate Invoice before Churn
Hi Experts, I need little help, I want to calucate the invoice amount of the customer before churn. I have two tables which connected with unique user id. User ID Churn Date
12568 03 ...
- 6 years ago
Perhaps:
Before Churn Column in Table 1= VAR __UserID = [User ID] VAR __ChurnDate = [Churn Date] VAR __DateBeforeChurn = MAXX( FILTER( 'Table2', 'Table2'[User ID] = __UserID && 'Table2'[Invoice Date] < __ChurnDate ), [Invoice Date] ) RETURN MAXX( FILTER( 'Table2', 'Table2'[User ID] = __UserID && 'Table2'[Invoice Date] = __DateBeforeChurn ), [Invoice Amount] )
Greg_Deckler
Community Champion
6 years agoPerhaps:
Before Churn Column in Table 1=
VAR __UserID = [User ID]
VAR __ChurnDate = [Churn Date]
VAR __DateBeforeChurn =
MAXX(
FILTER(
'Table2',
'Table2'[User ID] = __UserID &&
'Table2'[Invoice Date] < __ChurnDate
),
[Invoice Date]
)
RETURN
MAXX(
FILTER(
'Table2',
'Table2'[User ID] = __UserID &&
'Table2'[Invoice Date] = __DateBeforeChurn
),
[Invoice Amount]
)
shanipowerbi
Helper III
6 years agoThanks Problem solved Many thanks