Forum Discussion
SUM distinct values with multiple filters
- 6 years ago
Anonymous see if something like this will work for you.
Measure = CALCULATE ( SUMX ( VALUES ( measurements[feature_id] ), CALCULATE ( MAX ( measurements[km_length] ) ) ), measurements[new_state] = "UNVERIFIED" ) - 6 years ago
Anonymous I like to break measures and here is what you can do
Max Value = VAR __filter = FILTER( ALLEXCEPT ( Table, Table[Feature_Id ), Table[New State] = "Unverified" ) VAR __maxDate = CALCULATE ( MAX ( Table[Date] ), __filter ) RETURN CALCULATE ( MAX ( Table[Value] ), __filter Table[Date] = __maxDate ) Sum of Max value = SUMX ( VALUES ( Table[Feature_Id] ), [Max Value] )I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
parry2k is correct, based on your sample I made the assumption that the km_length would be the same for the same feature_id regardless of date so MAX was safe. If this is not the case you should look at his measures for your solution.
Yeah I managed to get parry2k's working, am currently trying both solutions and looking for discrepancies between the two. Based on my original claim, I do think his answer is more correct and will accept his solution. Thank you both