Forum Discussion
setis
Post Partisan
6 years agoUSERELATIONSHIP with several conditions
Dear experts, I am struggling with a measure in which I'm trying to combine USERELATIONSHIP and several filters. My measure is thefollowing: Membership Fee=
CALCULATE (
[TotalAmountGLEntry]...
- 6 years ago
Mariusz and amitchandak
It worked for me doing:
Membership Fee = VAR Acc3011 = CALCULATE ( [TotalAmountGLEntry]; USERELATIONSHIP ( '$G_L Entry'[Posting Date]; 'Date'[Date] ); USERELATIONSHIP('$G_L Entry'[CUSTOMER];'All Customers'[No_]); KEEPFILTERS ('$G_L Entry'[G_L Account No_] = "3011"); KEEPFILTERS ('$G_L Entry'[Document Type] = 2); KEEPFILTERS('$G_L Entry'[CUSTOMER] <> BLANK()) ) VAR Acc3016 = CALCULATE ( [TotalAmountGLEntry]; USERELATIONSHIP ( '$G_L Entry'[Posting Date]; 'Date'[Date] ); USERELATIONSHIP('$G_L Entry'[CUSTOMER];'All Customers'[No_]); KEEPFILTERS ('$G_L Entry'[G_L Account No_] = "3016"); KEEPFILTERS ('$G_L Entry'[Document Type] = 2); KEEPFILTERS('$G_L Entry'[CUSTOMER] <> BLANK()) ) RETURN Acc3011+Acc3016
Mariusz
Community Champion
6 years agoHi setis
Try this
Membership Fee =
CALCULATE(
CALCULATE (
[TotalAmountGLEntry];
KEEPFILTERS (
FILTER (
ALL (
'$G_L Entry'[G_L Account No_];
'$G_L Entry'[Document Type];
'$G_L Entry'[CUSTOMER]
);
'$G_L Entry'[G_L Account No_] = "3011"
|| '$G_L Entry'[G_L Account No_] = "3016"
|| '$G_L Entry'[Document Type] = 2
|| '$G_L Entry'[CUSTOMER] <> BLANK ()
)
)
);
USERELATIONSHIP ( '$G_L Entry'[Posting Date]; 'Date'[Date] )
)
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Mariusz
If this post helps, then please consider Accepting it as the solution.