Forum Discussion

Bebecirux's avatar
Bebecirux
Frequent Visitor
3 years ago
Solved

Find the last cost - DAX

Hi, how are you? Excuse me for being untidy, I don't know English and I use Google translator, I'll try to explain my problem better to see if you can help me.   i have the following problem!!!  ...
  • joaoribeiro's avatar
    3 years ago

    Hi Bebecirux ,

     

    You can use the following formula to create a Calculated Field with the FOB for the last last purchase date for each supplie/brand/product. Please change the table names, and the filtered columns according to your need:

     

    FOB Max Date =
    
    VAR MaxDate =
        CALCULATE(
            MAX('Table'[Fecha]),
            ALL('Table'[Ordem])
        )
    
    RETURN 
        CALCULATE(
            SUM('Table'[FOB]),
            FILTER('Table', 'Table'[Fecha] = MaxDate)
        )

     

     

     

    Hope this answer solves your problem!
    If you need any additional help please @ me in your reply.
    If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍

    Thanks!
    Best regards,
    Joao Ribeiro