Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Need help solving a practical FIFO issue, DAX measure or calculated column

Hello,   I have table that contains some sales data. I want to detect a product rotation issue. Effectively, I want each row to list the MAX production date of ENTRY TYPE SALE on a POSTING DATE tha...
  • MFelix's avatar
    7 years ago

    Hi Anonymous ,

     

    Try the following measure:

    Last_date =
    VAR Last_Date_Calculation =
        CALCULATE (
            MAXX ( 'Table'; 'Table'[Production Date] );
            FILTER (
                ALL ( 'Table'[Posting Date] );
                'Table'[Posting Date] < MAX ( 'Table'[Posting Date] )
            );
            ALLEXCEPT ( 'Table'; 'Table'[Item No]; 'Table'[Entry Type] )
        )
    RETURN
        IF ( Last_Date_Calculation = BLANK (); ""; Last_Date_Calculation )

    Regards,

    MFelix