Forum Discussion
How to use earlier formula
I have a table with claims ID and work orders related to those claims. One claim ID can have multiple work orders. I created the formula below but the problem is that it doesn't make sense when applied to ALL of the claims. How can I make it so that it does this ONLY for EACH claim. So, let's say there are 4 rows of claim 1, then the logic below will only look in those four rows....and then on to the next claim. Thanks.
Pricing Agreement = if(and([WorkOrderType]="First Time Dispatch",[Status]="Closed - Completed"),COBI_WorkOrder[PricingType],if([WorkOrderType]="Redispatch",[PricingType],blank()))
4 Replies
- alanhodgson
Solution Supplier
Hey ammartino44,
The article here gives a really good explanation of the EARLIER() function.
Hope this helps,
Alan
- Baskar
Resident Rockstar
Cool,
Highly recommended don't go with earlier it will give the performance issue if u have large data.
let me know if any help dear friend
- v-sihou-msft
Microsoft Employee
In this scenario, I don't think you need to use EARLIER() function. Your logic is applied on all rows. When it's done with couple of rows for same claim, it will go to next claim ID rows. If you want to achieve different logic for different cliam IDs, you should apply condition on [claim ID] in your IF statement. The EARLIER() function is to limit the table context on current row. It's not used to compare values in previous row directly. For more details, please see: EARLIER Function (DAX).
Regards,
- ammartino44
Helper III
No, it's a calculated column. It handles each row seperately, so all those if statements only relate to 1 row at a time, instead of 1 claim at a time (a claim can have multiple rows).