Forum Discussion
Find the last cost - DAX
- 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
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
thank you so much.
one more question
in case Table(Order) does not have a value, we can assign one with the IF BLANK "1" function as it should be done
Thanks again
- joaoribeiro3 years ago
Impactful Individual
Hi Bebecirux ,
Happy to know that it helped!
If you want to create a new column to fill the rows with blank Ordem with ones, you can use the following formula to create a Calculated Field:
Ordem Adjusted = IF(NOT ISBLANK('Table'[Ordem]), 'Table'[Ordem], 1)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