The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
AccountId | Amount | Stage | Recurring | CloseDate | New Column |
A | $10 | Closed Won | True | 2/1/22 | $5 - Previous Value (1/1/22) |
B | $5 | Closed Won | False | 2/11/22 | blank -as not recurring and no prior value |
A | $5 | Closed Won | True | 1/1/22 | $5 - Previous Value (12/1/21) |
C | $50 | Closed Lost | True | 2/1/22 | blank - while recurring, stage is closed lost. |
C | $100 | Closed Won | True | 1/1/22 | blank - no prior value |
A | $5 | Closed Won | True | 12/1/22 | blank - no prior value |
Solved! Go to Solution.
@samdep , Try like
New column =
var _max = CALCULATE(MAX(Opportunity[CloseDate]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = EARLIER(Opportunity[CloseDate])
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))
return
CALCULATE(Sum(Opportunity[Amount]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = _max
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))
Thank you so much! This works perfectly!!
@samdep , Try like
New column =
var _max = CALCULATE(MAX(Opportunity[CloseDate]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = EARLIER(Opportunity[CloseDate])
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))
return
CALCULATE(Sum(Opportunity[Amount]),
FILTER(Opportunity, Opportunity[AccountId] = EARLIER(Opportunity[AccountId])
&& Opportunity[CloseDate] = _max
&& Opportunity[StageName] = "Closed Won"
&& Opportunity[Recurring__c] = TRUE()))
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |