Forum Discussion
Anonymous
7 years agoNot applicable
Flag data at Certain Threshold
Hello - I am looking for some quick help here to meet a tight deadline. I am looking to flag certain customers in my data set once their aggregate $ amount hits a certain threshold (in this case $3,...
parry2k
7 years agoSuper User
Anonymous here is the measure, in your example,Customer B will not be flagged, his cummulative total is less than 3500
Flagged = VAR __value = CALCULATE( SUM( Table7[$ Value] ),FILTER( ALLEXCEPT(Table7, Table7[Customer] ), Table7[Date] <= MAX( Table7[Date] ) ) ) RETURN IF( __value > 3500, "Y" )
- Anonymous7 years agoNot applicable
parry2k this works to an extent, but there are customers that have contracts that are on the same date and if the customer exceeds the limit on that date, it will take ALL of the contracts that are booked on that date and flag them all, not just that contract and future ones. Is there a way to fix that logic by chance?
- parry2k7 years agoSuper User
Anonymous which contract will come first in the date???
- Anonymous7 years agoNot applicable
parry2k this is what I would expect to see. Contracts are in sequential numeric order as well.
Date Customer Contract $ Value Flagged 1/1/2019 Customer A Contract 1 1000 1/1/2019 Customer B Contract 2 1000 2/1/2019 Customer A Contract 3 2000 2/1/2019 Customer C Contract 4 2000 3/1/2019 Customer A Contract 5 250 3/1/2019 Customer A Contract 6 500 Y 3/1/2019 Customer B Contract 7 2000 4/1/2019 Customer A Contract 8 500 Y 4/1/2019 Customer C Contract 9 500 4/1/2019 Customer C Contract 10 1500 Y