Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi guys,
Hope you can help me, i have this table:
the data is not always sorted so, i am looking for the operator name where the id is the highest: this the following i was able to get the operator name by max wellid,
_CURRENT =
VAR TOPWELL = MAX('Well List'[WellID])
VAR _topclient =
CALCULATE(MAX('Well List'[Operator]), KEEPFILTERS( FILTER( ALL('Well List'[WellName], 'Well List'[Operator], 'Well List'[WellID]), 'Well List'[WellID] = TOPWELL)))
return _topclient
how can i identify in the main table the all the operators with the name as result of the measure? i tried:
IF( _topclient IN VALUES(Operator name), 1, 0)
but this returns all values as 1. Any idea?
Solved! Go to Solution.
Hi @Anonymous ,
Please try to create a calculated column with below formula to replace the original measure:
Column =
VAR _topclient =
CALCULATE (
MAX ( 'Well List'[Operator] ),
FILTER (
ALL ( 'Well List' ),
'Well List'[WellID] = MAX ( 'Well List'[WellID] )
)
)
RETURN
IF ( 'Well List'[Operator] = _topclient, 1, 0 )Best Regards
Rena
Hi,
Share the link from where i can download your PBI file.
@Anonymous - Not sure I completely understand, but perhaps this:
Measure = IF(MAX([Operator]) = [_CURRENT],1,0)
if i just return the variable _topclient :
_CURRENT =
VAR TOPWELL = MAX('Well List'[WellID])
VAR _topclient =
CALCULATE(MAX('Well List'[Operator]), KEEPFILTERS( FILTER( ALL('Well List'[WellName], 'Well List'[Operator], 'Well List'[WellID]), 'Well List'[WellID] = TOPWELL)))
return _topclientthe result is this:
so seems it is filtering row by row and not giving the proper result.
@Anonymous - I'm still now 100% clear but you may need an ALL or ALLEXCEPT in there to break out of the current context of the visual/row.
Any slightly idea where i should apply it?
Hi @Anonymous ,
Please try to update the formula of measure as below:
Flag =
VAR TOPWELL =
CALCULATE ( MAX ( 'Well List'[WellID] ), ALL ( 'Well List' ) )
VAR _topclient =
CALCULATE ( MAX ( 'Well List'[Operator] ), 'Well List'[WellID] = TOPWELL )
RETURN
IF ( MAX ( 'Well List'[Operator] ) = _topclient, 1, 0 )Best Regards
Rena
Hi @Anonymous ,
Thanks for your answer, i already tried that way before with the result but, i see in your example you have two "JJ", so basically how would you add the 1 value in all the JJ's in the column?
Hi @Anonymous ,
Please try to create a calculated column with below formula to replace the original measure:
Column =
VAR _topclient =
CALCULATE (
MAX ( 'Well List'[Operator] ),
FILTER (
ALL ( 'Well List' ),
'Well List'[WellID] = MAX ( 'Well List'[WellID] )
)
)
RETURN
IF ( 'Well List'[Operator] = _topclient, 1, 0 )Best Regards
Rena
@Anonymous I don't understand why we are all after creating the column when measure can do the job. Do we understand the difference between creating measure vs columns and how it has an impact on the model?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous @Anonymous solution should work, not sure why is not showing 1 for each JJ operator, I created sample data and used following measure
Top Operator =
VAR __topId = CALCULATE ( MAX ( Well[Id] ), ALL ( Well ) )
VAR __topOpertor = CALCULATE ( MAX ( Well[Operator] ), Well[Id] = __topId )
RETURN IF ( MAX ( Well[Operator] ) = __topOpertor, 1, 0 )
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.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Greg_Deckler ,
Thanks for your answer, i still got the same result as 1, i know Max will be interating row by row but wondering why not recognizing the _topclient variable.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 41 | |
| 22 | |
| 17 |
| User | Count |
|---|---|
| 183 | |
| 114 | |
| 93 | |
| 62 | |
| 45 |