SQL to DAX Conversion

Tags: SQL, TSQL, DAX, convert, conversion

SELECT TOP(1) InventTrans.CustVendAC

FROM InventTrans

       WHERE  InventTrans.DataAreaId            = 'DAT'

              AND    InventTrans.StatusReceipt  = 1

             AND    InventTrans.ItemId         = '85380'

       ORDER BY InventTrans.DatePhysical DESC

=CALCULATE(FIRSTNONBLANK(InventTrans[CustVendAC]; 1); TOPN(1; FILTER('InventTrans'; 'InventTrans'[ItemId]=EARLIER('InventTrans'[ItemId])); 'InventTrans'[DatePhysical]; 0); FILTER('InventTrans'; 'InventTrans'[StatusReceipt]=1)).

DAX equivalent of SQL NOT IN:

MEASURE NOT IN =
CALCULATE (
    SUM ( Table1[Value] );
    FILTER (
        Table1;
        Table1[Category] = "C"
            && NOT ( Table1[CAT LEVEL] ) IN { 2; 3 }
    )
)