Forum Discussion
Find row value based on two other columns
- 4 years ago
prof_hoo Try this measure, change table and column name as per your model
Top Type = CALCULATE ( MAX ( HighType[Type] ), TOPN ( 1, ALLSELECTED ( HighType[Type] ), CALCULATE ( SUM ( HighType[Value] ) ), DESC ) )Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort 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.
prof_hoo you can simply add a column in your table using following DAX expression and then use it in the visuals:
New Type =
VAR __state = Table[State]
RETURN
SWITCH ( __state,
"California", "W",
"Vermont", "Z",
"Alabama", "Z",
"Y"
)
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort 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.
This isn't the real data; the actual data is much larger and is constantly changing, so hard-coding a solution doesn't work. Thanks though!
- parry2k4 years ago
Super User
prof_hoo I don't understand what do you mean by hardcoding, you provided the logic and the solution is based on your ask.
You need to provide more details to explain the logic so that community can provide you the help.
- prof_hoo4 years agoFrequent Visitor
Apologies; I edited my post to better explain the logic I'm looking to create.