Forum Discussion
JMG241188
3 years agoHelper I
Use CALCULATETABLE to return latest version
Hey, I thought I solved my problem but it is still not summarising the way I want. In breif, I have a table with a contract idea, a status, and a version number, and I want the table to alway...
amitchandak
3 years agoSuper User
JMG241188 , refer these measure option
Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
- JMG2411883 years agoHelper I
Hey amitchandak , I have an issue with the formula above, it worked in certain visuals, but not for others.
I ended up with the following formula;
LatestVersion = var _max = maxx(filter(ALLSELECTED(Contracts), Contracts[Master Contract Version Id] = Max(Contracts[Master Contract Version Id])), Contracts[Version Number])returnCALCULATE(max(Contracts[Version Number]), filter((Contracts) , Contracts[Version Number] = _max))This is OK to use as a Is Not Blank filter on tables where each contract is separated, but it doesn't work when the data is aggregated.What I need to do is return the $ limit of each of the latest versions, summed up together. I tried to change what the formula was returning, and again, it works at line level, but when aggregating contracts together, it only returns one value. Which is likely expected with the DAX measure, but I need to know how to take all of these limits, and sum them together.LatestVersionLimit = var _max = maxx(filter(ALLSELECTED(Contracts), Contracts[Master Contract Version Id] = Max(Contracts[Master Contract Version Id])), Contracts[Version Number])returnCALCULATE(SUM('Contract Sections'[Overall Limit]), filter((Contracts) , Contracts[Version Number] = _max))Thanks so much,J