Forum Discussion
petersoelberg
6 years agoFrequent Visitor
Calculated colum - latest version of document
Hi! I have been searching for a similar case for a couple of days but I am unable to find a relatable solution so I hope one of you will be abe to help me with my enquiry. I have a sales order a...
- 6 years ago
petersoelberg - This is basic use of EARLIER:
Column = VAR __Max = MAXX(FILTER('Table',[Document no] = EARLIER([Document no])),[Version no]) RETURN IF([Version no] = __Max,"Latest","Archived")For more complex versions, See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586
camargos88
Community Champion
6 years agoHi petersoelberg ,
Try this code:
Column =
VAR _maxVersion = CALCULATE(MAX('Table'[Version no.]), FILTER('Table', 'Table'[Document no] = EARLIER('Table'[Document no])))
RETURN IF('Table'[Version no.] = _maxVersion, "Latest", "Archived")