Forum Discussion
Tob_P
Helper V
1 year agoCalculated column - two values, only return the last value
Hi, I would like to created a calculated column to return the last value in the Cust No column based on the lastest posting date. So in the example you can access through the link, the new column...
- Anonymous1 year ago
Hi Tob_P
Thank you very much powerbiexpert22 for your prompt reply.
Try this:
LastCustNo = VAR LatestDate = CALCULATE( MAX('Sales'[Posting Date]), ALLEXCEPT('Sales', 'Sales'[Reporting Cust No]) ) RETURN CALCULATE( MAX('Sales'[Cust No]), FILTER( 'Sales', 'Sales'[Posting Date] = LatestDate && 'Sales'[Reporting Cust No] = EARLIER('Sales'[Reporting Cust No]) ) )Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
powerbiexpert22
Impactful Individual
1 year agoHi Tob_P ,
I am not sure what you are looking sorry, you can try to utilize SUMMARIZE () in DAX based on your need