Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ammartino44
Helper III
Helper III

Complicated Rule based formula

Hello. This might be complicated. 

I have a claims table that is the lookup table and a work table attached. The work order tables has work order number, work order type, work order pricing agreement and work order status. 

I want to associate work orders with a "type" = "cashout" with their pricing agreement type. 

Here are the rules:

1) For ALL cashouts (cashouts are only counted if work order status= closed/completed), use the pricing agreement of the first work order on that specific claim. 

2) If there is a redispatch work order AND the status of the first time dispatch = closed/cancelled

3) Only count cashouts if they have a status of "closed/completed"

4) Sort all this based on claims created date. 

 

Picture of spreadsheet attached. Thanks!!

 

Helpie.png

2 REPLIES 2
ammartino44
Helper III
Helper III

I was able to work this out in the claims table, but this still doesn't help me with the pricing agreement aspect of things. 

 

=CALCULATE(counta(WorkOrder[WO Type]),WorkOrder[WO Type]="Cashout",WorkOrder[Status]="Closed/Completed")

Hi @ammartino44,

 

You can try to use bleow measure if it works on your side.

 

Count of Specify Rules=
var currType= LastNoBlank(TABLE[Pricing Agreement],[Pricing Agreement])
return
COUNTROWS(
FILTER(
ALL(TABLE),
[Pricing Agreement]=currType&&
OR(
OR([WO Type]="First TIme Dispath",[WO Type]="Cashout")&&[Status]= "closed/completed", 
[WO Type]="Redispath"&&[Status]= "closed/cancelled")))

 

If above is not help, please share me a sample file to test.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.