DAX Expressions New

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 10

sql-movemedical-prod-useast-01.database.windows.

net
sqldb-bi

EU COMMODITY CODE Discrepancy =


var a = RELATED('Item_BasicInfo'[DFF EU Commodity Code])
var b = 'Item_Orginfo'[Org EU Commodity Code]
var c=RELATED(Organization[Organization Code])
var d = SWITCH(TRUE(),
(a=b)||(a<>BLANK() && b=BLANK())||(a=BLANK() && b=BLANK()),"NO",
(a=BLANK() && b<>BLANK()),"YES",
(c IN {"191","415"} ) && (a<>b),"NO","YES")
return d

ECCN Discrepancy =
var a = RELATED('Item_BasicInfo'[DFF ECCN])
var b = 'Item_Orginfo'[Org ECCN]
var c=RELATED(Organization[Organization Code])
var d = SWITCH(TRUE(),
(a=b)||(a<>BLANK() && b=BLANK())||(a=BLANK() && b=BLANK()),"NO",
(a=BLANK() && b<>BLANK()),"YES",
(c IN {"135","191","415"} ) && (a<>b),"NO","YES")
return d

ECCN in Org 135 = CALCULATE(MAX(Item_OrgInfo[Org


ECCN]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_Orginfo[Organization ID]=6780))
ECCN in Org 191 = CALCULATE(MAX(Item_OrgInfo[Org
ECCN]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_Orginfo[Organization ID]=5353))
EU Commodity Code in 191 = CALCULATE(MAX(Item_OrgInfo[Org EU Commodity
Code]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_OrgInfo[Organization ID]=5353))
EU Commodity Code in Org 415 = CALCULATE(MAX(Item_OrgInfo[Org EU Commodity
Code]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_OrgInfo[Organization ID]=6782))
EU ECCN in Org 415 = CALCULATE(MAX(Item_OrgInfo[Org
ECCN]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_Orginfo[Organization ID]=6782))
Item Status MST = CALCULATE(MAX(Item_OrgInfo[Item
Status]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_BasicInfo[Organization ID]=83))

510k/PMA/Exempt Discrepancy = Switch(True(),


Related(Item_BasicInfo[DFF 510k/PMA/Exempt])<>BLANK() &&
Item_Orginfo[DFF_510k/PMA/Exempt]=BLANK(),"NO",
Related(Item_BasicInfo[DFF 510k/PMA/Exempt])=BLANK() &&
Item_Orginfo[DFF_510k/PMA/Exempt]<>BLANK()
|| (Related(Item_BasicInfo[DFF
510k/PMA/Exempt])<>Item_Orginfo[DFF_510k/PMA/Exempt]),"YES","NO")

COO Discrepancy = Switch(True(),


Related(Item_BasicInfo[DFF Country of Origin])<>BLANK() && Item_Orginfo[ORG
COO]=BLANK(),"NO",
Related(Item_BasicInfo[DFF Country of Origin])=BLANK() && Item_Orginfo[ORG
COO]<>BLANK()
|| (Related(Item_BasicInfo[DFF Country of Origin])<>Item_Orginfo[ORG
COO]),"YES","NO")

Org-Assembly Item ID = Bill_of_Materials[Organization ID] & "-" &


Bill_of_Materials[Assy Item ID]

Invoice Aging Bucket =


IF('Invoice Payments'[Invoice payments Aging] <=0 ,"Within Terms",
IF('Invoice Payments'[Invoice payments Aging] >=1 && 'Invoice Payments'[Invoice
payments Aging]<=7,"00-07 Days" ,
IF('Invoice Payments'[Invoice payments Aging] >=8 && 'Invoice Payments'[Invoice
payments Aging]<=30 ,"08-30 Days" ,
IF('Invoice Payments'[Invoice payments Aging] >30 , "+30 Days", "Aging Error"))))

ECCN Discrepancy =
var a = RELATED(Item_BasicInfo[DFF ECCN]
var b = Item_Orginfo[Org ECCN]
var c = if(Item_Orginfo[Organization ID]=6782,(if(a<>b,"YES"))
return c

ECCN Discrepancy = Switch(True(),


(Item_Orginfo[MST ECCN]=BLANK() && Item_Orginfo[Org ECCN]<>BLANK())||
(IF( NOT ( Item_Orginfo[Organization ID] IN (values( 6782,5353,66782))))
&&
Item_Orginfo[MST ECCN]<>Item_Orginfo[Org ECCN])),"YES","NO")

IF( NOT ( Item_Orginfo[Organization ID] IN


(values( 6782,5353,66782))))

ECCN Discrepancy =
IF(not(
Item_Orginfo[Organization ID] IN{6782,5353,66782} &&
Item_Orginfo[MST ECCN]<>Item_Orginfo[Org ECCN]), "NO",
IF((
Item_Orginfo[Organization ID] IN{6782,5353,66782} &&
Item_Orginfo[MST ECCN]<>Item_Orginfo[Org ECCN]),"YES"))

ECCN Discrepancy =
IF(not( Item_Orginfo[Organization ID] IN{6782,5353,66782} && Item_Orginfo[MST
ECCN]<>Item_Orginfo[Org ECCN]),"YES","NO")
//IF(( Item_Orginfo[Organization ID] IN{6782,5353,66782} && Item_Orginfo[MST
ECCN]<>Item_Orginfo[Org ECCN]),"NO")

COO Discrepancy = Switch(True(),


Item_Orginfo[MST COO]=BLANK() && Item_Orginfo[ORG COO]<>BLANK()||
Item_Orginfo[MST COO]<>Item_Orginfo[ORG COO],
"YES","NO")

ECCN Discrepancy = Switch(True(),


IF(( Item_Orginfo[Organization ID] IN{6782,5353,66782} && Item_Orginfo[MST
COO]=BLANK() && Item_Orginfo[ORG COO]<>BLANK()) "YES","NO")

Org-Assembly Item ID = Bill_of_Materials[Organization ID] & "-" &


Bill_of_Materials[Assy Item ID]

EU ECCN in Org 415 = CALCULATE(MAX(Item_OrgInfo[Org


ECCN]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_Orginfo[Organization ID]=6782))
Item Status MST = CALCULATE(MAX(Item_OrgInfo[Item
Status]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_BasicInfo[Organization ID]=83))

Assigned to Position =
var cntPosition = CALCULATE(COUNTROWS(Control_Functions))
RETURN
IF(cntPosition>0,"Yes","No")

Hold Owner = SWITCH(TRUE(),


'Invoice Holds'[Hold Name] in
{"PO NOT APPROVED","PRICE","QTY ORD","QTY REC","Integra Service PO Hold","INTG Non-
PO Utility Hold","INVALID PO","INTG Signature Approval","QUALITY",
"AMOUNT","NO RATE"},"Business",'Invoice Holds'[Hold Name] in {"PO REQUIRED","LINE
VARIANCE","DIST VARIANCE","Tax Tolerance Hold","Legal Entity Assignment E",
"VENDOR","Tax Shortpay Hold","Tax Process Error Hold","Integra Rejected
Payment","INTG Manual Payment Requi","INTG Banking Hold","INTG Address Change
Hold",
"Tax Tolerance Hold","Tax Determination Hold","TAX VARIANCE"},"AP",
'Invoice Holds'[Hold Name] in {"Integra Stale Dated Check"} , "State Dated Check" ,
'Invoice Holds'[Hold Name] in {"CANNOT EXECUTE ALLOCATION"}, "System" ,'Invoice
Holds'[Hold Name] in {"Unclaimed Property Hold"}, "Unclaimed Property Hold")

Discount Lost & Taken = IF('Invoice Payments'[Discount Taken]=0 && 'Invoice


Payments'[Discount Lost]=0,1,0)

Invoice Aging Bucket = IF('Invoice Payments'[Invoice payments Aging] <=0 ,"Within


Terms", IF('Invoice Payments'[Invoice payments Aging] >=1
&& 'Invoice Payments'[Invoice payments Aging]<=7,"00-07 Days" , IF('Invoice
Payments'[Invoice payments Aging] >=8
&& 'Invoice Payments'[Invoice payments Aging]<=30 ,"08-30 Days" ,IF('Invoice
Payments'[Invoice payments Aging] >30 , "+30 Days", "Aging Error"))))

Payment Method Type Bucketing = SWITCH(TRUE(),Payments[PaymentMethod & TypeFlag] in


{"A--ACH","M--ACH","Q--ACH","M--JPMC SUA","A--JPMC SUA",
"A--MANUAL","A--WIRE","M--WIRE","Q--WIRE","R--WIRE"},"Electronic
Payment",Payments[PaymentMethod & TypeFlag] in {"A--Cheque","A--Cheque",
"A--OUTSOURCED_CHECK","M--OUTSOURCED_CHECK"} ,"US-Check",Payments[PaymentMethod &
TypeFlag] in {"A--INTG_PNC_NET","M--INTG_PNC_NET","Q--INTG_PNC_NET",
"R--INTG_PNC_NET"},"I/C Netting",Payments[PaymentMethod & TypeFlag] in {"M--
MANUAL","Q--MANUAL","R--MANUAL"}, "Wires Manual")

EU Commodity Code in 191 = CALCULATE(MAX(Item_OrgInfo[DFF EU Commodity


Code]),FILTER(RELATEDTABLE(Item_OrgInfo),Item_OrgInfo[Organization ID]=5353))
(COLUMN)

PO Amount Bucket =
var a = 'Purchase Order Bucket'[USD Amount]

var b = if(a<=1000," 0-1000",


if(a<=5000," 1001-5000",
if(a<=25000," 5001-25000",
if(a<50000,"25001-
50000","50000+"))))
return b

Aging =
if(TODAY()-PurchaseOrder[PO Creation Date]< 120,"00-04 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]< 180,"04-06 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]< 270,"07-09 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]< 365,"10-12 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]<540,"1.0-1.5 Years",
if(TODAY()-PurchaseOrder[PO Creation Date]<730,"1.5-2 Years",
if(TODAY()-PurchaseOrder[PO Creation Date]< 1095,"2-3 Years","over 3
Years")))))))

Opportunity Type =
VAR rslt = SWITCH(TRUE(),
ItemInstance[Remaining Life based on IB Creation Date]<=0,"Capital
Opp.",
ISBLANK(RELATED('Latest Contract'[Contract Number])),"New Contract
Opp.",
RELATED('Latest Contract'[Header Status])="EXPIRED" &&
RELATED('Latest Contract'[Contract Service Type])="WARRANTY","Exp Warranty Cont
Opp.",
RELATED('Latest Contract'[Header Status])="EXPIRED" &&
RELATED('Latest Contract'[Contract Service Type])="SERVICE","Service Renewal Cont
Opp.",
RELATED('Latest Contract'[Contract Service Type])="WARRANTY", "New
Contract Opp." ,
"Service Renewal Cont Opp."
)
RETURN
rslt

Opportunity Year =
var yr = YEAR(RELATED('Latest Contract'[End Date]))
var curYear = YEAR(TODAY())
return
SWITCH(TRUE(),
ISBLANK(yr),curYear,
MAX(yr,curYear))

\\(c IN {"191","415"} ) && (a<>b),"NO",


\\(NOT(c IN {"191","415"} )) && (a<>b),"YES",
\\(c IN {"191","415"} ) && (a=BLANK() && b<>BLANK()),"YES",
\\(NOT(c IN {"191","415"} )) && (a=BLANK() && b<>BLANK()),"YES",
\\(c IN {"191","415"} ) && (a<>BLANK() && b=BLANK()),"NO",
\\(NOT(c IN {"191","415"} )) && (a<>BLANK() && b=BLANK()),"NO",
\\(c IN {"191","415"} ) && (a=BLANK() && b=BLANK()),"NO",
\\(NOT(c IN {"191","415"} )) && (a=BLANK() && b=BLANK()),"NO","YES")

Invoice Variance FLAG = IF([Invoice Count Difference]=0,"NO","YES")

Measures:
% <2 Days Invoices = DIVIDE([Entered <2 Days Past Recieved Date],[Total Invoices
With Received Dates],0)
% ≥30 Days holds = DIVIDE([≥30 Days holds],Count('Invoice Holds'[Hold Id]),0)

Total Invoices With Received Dates = CALCULATE(count('Invoice Header'[Invoice


ID]),not(ISBLANK('Invoice Header'[Invoice Received Date ])))

Discvount Lost & Taken = IF('Invoice Payments'[Discount Taken]=0 && 'Invoice


Payments'[Discount Lost]=0,1,0)

Invoice Aging Bucket = IF('Invoice Payments'[Invoice payments Aging] <=0 ,"Within


Terms",
IF('Invoice Payments'[Invoice payments
Aging] >=1 && 'Invoice Payments'[Invoice payments Aging]<=7,"00-07 Days" ,
IF('Invoice Payments'[Invoice
payments Aging] >=8 && 'Invoice Payments'[Invoice payments Aging]<=30 ,"08-30 Days"
,
IF('Invoice
Payments'[Invoice payments Aging] >30 , "+30 Days", "Aging Error"))))

Invoice payments Aging = DATEDIFF('Invoice Payments'[Due Date],'Invoice


Payments'[Payment Date],DAY)

Total Discount = 'Invoice Payments'[Discount Lost]+'Invoice Payments'[Discount


Taken]

Vendor Num Name = CONCATENATE(CONCATENATE(VendorSite_PO[Vendor


Number],"-"),VendorSite_PO[Vendor Name])

Vendor Num Name = CONCATENATE(CONCATENATE(VendorSite_PO[Vendor


Number],"-"),VendorSite_PO[Vendor Name])

Inspection Days = DATEDIFF(Receipts[Receipt Date],Receipts[Inspected Date],DAY)

Aging =
if(TODAY()-PurchaseOrder[PO Creation Date]< 120,"00-04 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]< 180,"04-06 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]< 270,"07-09 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]< 365,"10-12 Months",
if(TODAY()-PurchaseOrder[PO Creation Date]<540,"1.0-1.5 Years",
if(TODAY()-PurchaseOrder[PO Creation Date]<730,"1.5-2 Years",
if(TODAY()-PurchaseOrder[PO Creation Date]< 1095,"2-3 Years","over 3
Years")))))))

Balance Amount USD = PurchaseOrder[Amount USD]-PurchaseOrder[Amount Billed USD]

Quantity Remaining = PurchaseOrder[Quantity Ordered]-PurchaseOrder[Quantity


Billed]-PurchaseOrder[Quantity Rejected]

Rejected Amount USD = PurchaseOrder[Quantity Rejected]*PurchaseOrder[Unit


Price]*PurchaseOrder[USD Conversion]

Remaining Open PO Balance USD = IF(PurchaseOrder[Line Closed Code] in


{"CLOSED","FULLY CLOSED"},0,PurchaseOrder[Remaining PO Balance])

Remaining PO Balance = (PurchaseOrder[Unit Price]*PurchaseOrder[Quantity


Remaining])*PurchaseOrder[USD Conversion]
USD Conversion =
var a = LOOKUPVALUE(FxRateToUsd[Conversion Rate],FxRateToUsd[From
Currency],PurchaseOrder[Currency])

var b = if(PurchaseOrder[Currency]="USD",1,a)

return b

PO Amount Bucket =
var a = 'Purchase Order Bucket'[USD Amount]

var b = if(a<=1000," 0-1000",if(a<=5000," 1001-5000",if(a<=25000," 5001-


25000",if(a<50000,"25001-50000","50000+"))))

return b

Count of Holding days =


CALCULATE(COUNTROWS('Calendar'),FILTER('Calendar',WEEKDAY('Calendar'[TheDate],2)<6)
,
DATESBETWEEN('Calendar'[TheDate],'Invoice Holds'[Hold Date],TODAY()))

Hold Aging = if ([Days On Hold] <= 30, "0-30 Days" , if ([Days On Hold] <= 60 ,
"31-60 Days" , if ([Days On Hold] <= 90 , "61-90 Days" ,
if ([Days On Hold]<= 120 , "91-120 Days" , "Over 120 Days"))))

Hold Aging = if ([Days On Hold] <= 30, "0-30 Days" , if ([Days On Hold] <= 60 ,
"31-60 Days" , if ([Days On Hold] <= 90 , "61-90 Days" ,
if ([Days On Hold]<= 120 , "91-120 Days" , "Over 120 Days"))))

Hold Owner = SWITCH(TRUE(),'Invoice Holds'[Hold Name] in {"PO NOT


APPROVED","PRICE","QTY ORD","QTY REC","Integra Service PO Hold","INTG Non-PO
Utility Hold","INVALID PO","INTG Signature Approval","QUALITY","AMOUNT","NO
RATE"},"Business",'Invoice Holds'[Hold Name] in {"PO REQUIRED","LINE
VARIANCE","DIST VARIANCE","Tax Tolerance Hold","Legal Entity Assignment
E","VENDOR","Tax Shortpay Hold","Tax Process Error Hold","Integra Rejected
Payment","INTG Manual Payment Requi","INTG Banking Hold","INTG Address Change
Hold","Tax Tolerance Hold","Tax Determination Hold","TAX VARIANCE"
},"AP",'Invoice Holds'[Hold Name] in {"Integra Stale Dated Check"} , "State Dated
Check" ,'Invoice Holds'[Hold Name] in {"CANNOT EXECUTE ALLOCATION"},
"System" ,'Invoice Holds'[Hold Name] in {"Unclaimed Property Hold"}, "Unclaimed
Property Hold")

Measure = calculate(average('Invoice Holds'[Due Days]),filter('Invoice


Holds','Invoice Holds'[Invoice ID]))

Discount Lost & Taken = IF('Invoice Payments'[Discount Taken]=0 && 'Invoice


Payments'[Discount Lost]=0,1,0)

Invoice Aging Bucket = IF('Invoice Payments'[Invoice payments Aging] <=0 ,"Within


Terms", IF('Invoice Payments'[Invoice payments Aging] >=1 && 'Invoice
Payments'[Invoice payments Aging]<=7,"00-07 Days" , IF('Invoice Payments'[Invoice
payments Aging] >=8 && 'Invoice Payments'[Invoice payments Aging]<=30 ,"08-30 Days"
,IF('Invoice Payments'[Invoice payments Aging] >30 , "+30 Days", "Aging Error"))))

Invoice payments Aging = DATEDIFF('Invoice Payments'[Due Date],'Invoice


Payments'[Payment Date],DAY)
Total Discount = 'Invoice Payments'[Discount Lost]+'Invoice Payments'[Discount
Taken]

Invoice Hold Flag = IF(ISBLANK('Invoice Header'[Hold Id]),"NO","YES")

Payment Term Flag = IF('Invoice Distribution'[PO Payment Term]='Invoice


Distribution'[ Invoice Payment Terms],"YES","NO")

PO Payment Term = RELATED(PurchaseOrder[Payment Term])

Amount Limit in USD =


var a = LOOKUPVALUE(FxRateToUsd[Conversion Rate],FxRateToUsd[From
Currency],Control_Group[OU Currency])
var b = if(Control_Group[OU Currency]="USD",1,a)*(Control_Group[Amount Limit In OU
Currency])
Return b

Assigned to Position =
var cntPosition = CALCULATE(COUNTROWS(Control_Functions))
RETURN
IF(cntPosition>0,"Yes","No")

Product Division = RELATED(DCode_GlobalProductRollup[Product Division Code])

Blizzard Modifier Flag =


VAR cnt = CALCULATE(COUNTROWS('Discount List Lines'),'Discount List
Lines'[Product Division]="BLIZZARD")
RETURN
IF(cnt>0,"Y","N")

BillTo matches EndDest = IF('Bill To Country'[Bill To Country]='Bill To


Country'[End Destination Country],1,0)

End Destination Country =


var edc = RELATED(EndDestCountryException[Country Code 2-Digit])
RETURN
IF(NOT(ISBLANK(edc)),edc,'Bill To Country'[Bill To Country])

PaymentMethod & TypeFlag = CONCATENATE(Payments[Payment Type


Flag],CONCATENATE("--",Payments[Payment Method]))

Org-Assembly Item ID = Bill_of_Materials[Organization ID] & "-" &


Bill_of_Materials[Assy Item ID]
CONCAT([sll].JE_Header_Id, '-' ,[sll].GL_line_number) AS "JE Header - Line
Number",
--------------------------------------------
Transaction Date No timestamp = DATE(YEAR(JobOperationMoveTransaction[Transaction
Date]),MONTH(JobOperationMoveTransaction[Transaction
Date]),DAY(JobOperationMoveTransaction[Transaction Date]))
--------------------------------------------------
Modifier Line Creation Year = YEAR('Discount List Lines'[Line Creation Date])
-------------------------------------------------------------------------------

Mansfield Equipment =
switch(true(),
JobOperationMoveTransaction[From Operation Description]="L32 LATHE"
&& JobOperationMoveTransaction[From Intra Operation Step Type]="QUEUE"
&& RELATED(Job_Assembly[Assembly]) in {"260122001"}, "lathe",
"tEST")

L32 = CALCULATE(sum(JobOperationMoveTransaction[Primary
Quantity]),filter(Job_Assembly,Job_Assembly[Assembly] in
{"260122001","260122003"}),filter(JobOperationMoveTransaction,JobOperationMoveTrans
action[From Operation Description]="L32
LATHE"),FILTER(JobOperationMoveTransaction,JobOperationMoveTransaction[From Intra
Operation Step Type]="QUEUE"))

PM
MEASURE
Latest Completion Date = MAX('Preventive_WO'[Completion Date])

Delay Jobs % = DIVIDE('_Measures'[Count of Delay WO], '_Measures'[Count of


Preventive WO])

Count of WO = '_Measures'[Count of Preventive WO] + '_Measures'[Count of Corrective


WO]

Count of Preventive WO = DISTINCTCOUNT('Preventive_WO'[Work Order Number])

Count of Delay WO = CALCULATE(COUNT('Preventive_WO'[Work Order


Number]),'Preventive_WO'[Delay?] = "Yes")

Count of Corrective WO = DISTINCTCOUNT('Corrective WO'[Work Order Number])

Count of Asset ID = DISTINCTCOUNT('Asset'[Asset ID])

Corrective Jobs % = DIVIDE('_Measures'[Count of Corrective WO],'_Measures'[Count of


WO])

column
Last PM Date = CALCULATE(MAX('Preventive_WO'[Completion Date]))
Next PM Date = CALCULATE(MIN('Preventive_WO'[Scheduled Completion
Date]),'Preventive_WO'[Status]="Released")
Active? = IF((ISBLANK('Asset'[Activity End Date]) && NOT(ISBLANK('Asset'[Activity
Start Date]))), "Yes",IF(ISBLANK('Asset'[Activity End Date]),"Unknown","No"))
Active? = IF((ISBLANK('PM Schedule'[To Effective Date])&&NOT(ISBLANK('PM
Schedule'[From Effective Date]))), "Yes",IF(ISBLANK('PM Schedule'[From Effective
Date]),"Unknown","No"))
Shutdown Leadtime (MTTR) = DATEDIFF('Preventive_WO'[Shutdown End
Date],'Preventive_WO'[Actual Start Date],DAY)

Technician =
VAR wip_entity_id = 'Preventive_WO'[WIP Entity ID]
RETURN
CALCULATE(MAX('Operations'[User Name]), FILTER('Operations', 'Operations'[WIP
Entity ID] = wip_entity_id))

Inspection Due =
switch(true(),
'Preventive WO'[Work Order Number] <>BLANK()
&& 'Preventive WO'[Status]="Released" , "Yes","No")

Inspection Due =
switch(true(),
Preventive_WO[Work Order Number] <>BLANK() &&
Preventive_WO[Status]="Released" && ISBLANK('PM Schedule'[To Effective Date])))

Inspection Due = Switch(True(),


IF(( Preventive_WO[Work Order Number] <>BLANK() && Preventive_WO[Status]="Released"
&& Item_Orginfo[MST COO]=BLANK())) "YES","NO")

Active? = IF(
(
ISBLANK('Asset'[Activity End Date])
&&
NOT(
ISBLANK('Asset'[Activity Start Date])
)), "Yes",IF(ISBLANK('Asset'[Activity End Date]),"Unknown","No"))

Active1? = IF(
(
ISBLANK(Preventive_WO[Work Order Number])
&&
NOT(
ISBLANK(Filter(QA_Discrepancy,QA_Discrepancy[Work_Order])
))
&& Preventive_WO[Status]="Released"),"Yes","No"))

Due? =
var a = Preventive_WO[Status]
var b =Preventive_WO[Work Order Number]
var c = Filter(QA_Discrepancy,QA_Discrepancy[Work_Order])
var d = if(a="Released" && c = BLANK()), "YES","NO"
Return d

You might also like