Forum Discussion
Anonymous
5 years agoNot applicable
Choose earliest value as true value
Hi, I'm stuck on this annoying problem. I would like to indicate where the highest cost arises based on - NAME - ALIAS - BRANCH - MONTH Now my following MAX(COST)-column makes the follow...
parry2k
Super User
5 years agoAnonymous 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.⚡
Anonymous
5 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 🙂