Forum Discussion
Choose earliest value as true value
Anonymous here is the measure and the result
Max Cost =
VAR __table =
ALLEXCEPT (
'Cost',
'Cost'[MONTH],
'Cost'[NAME],
'Cost'[ALIAS],
'Cost'[BRANCH]
)
VAR __id =
CALCULATE (
MIN ( Cost[ID] ),
TOPN ( 1, __table, CALCULATE ( MAX ( Cost[COST] ) ), DESC )
)
VAR __return =
IF ( MIN ( Cost[ID] ) = __id , 1 )
RETURN __return
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to 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.⚡
- Anonymous5 years agoNot applicable
What if I don't have an ID-column? How should I then approach it? I know it sounds silly, but making this code work without using the ID would be better in my case 🙂
- Anonymous5 years agoNot applicable
When I try the code it just gives me the circular reference error. How can that be?
- v-henryk-mstf5 years ago
Community Support
Hi Anonymous ,
You need to copy the code to measure instead of calculated column.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.