Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Card value based on another column

Hi there,

 

I want to show in a card the name of the client who earned the most in a date range. I have these two tables which are DirectQueries. 

 

I know it surely is obvious for a lot of you, but I'm still in process of learning the basics.

 

Is there any way I can do it? Any help or advice would be kindly appreciated!

 

 

 

COD_CLIENTNAME
1Jack
2Louise
3Frank
COD_CLIENTEARNINGS
2$4,879.03
1$271,88
3$89,764
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Please Try This measure
_name =
VAR  _MAX =
MAX ( 'Table_name(1)'[_CLIENTEARNINGS] )
VAR MAX_NAME =
CALCULATE (
MAX ( 'Table_name'[_CLIENTEname] ),
FILTER ( 'Table_name', 'Table_name(1)'[_CLIENTEARNINGS] = _MAX )
)
RETURN
MAX_NAME

View solution in original post

truptis
Community Champion
Community Champion

Hi @Anonymous,

Please try this:
Result = var max_earning = max('tablename'[CLIENTEARNINGS])
 RETURN 

CALCULATE (
MAX ( 'Tablename'[CLIENTNAME] ),
FILTER ( 'Tablename', 'Tablename'[CLIENTEARNINGS] = max_earning )
)

@Anonymous - Please mark it as a solution, if it helps you. Thanks. 

 

Regards,

TruptiS

View solution in original post

2 REPLIES 2
truptis
Community Champion
Community Champion

Hi @Anonymous,

Please try this:
Result = var max_earning = max('tablename'[CLIENTEARNINGS])
 RETURN 

CALCULATE (
MAX ( 'Tablename'[CLIENTNAME] ),
FILTER ( 'Tablename', 'Tablename'[CLIENTEARNINGS] = max_earning )
)

@Anonymous - Please mark it as a solution, if it helps you. Thanks. 

 

Regards,

TruptiS

Anonymous
Not applicable

Please Try This measure
_name =
VAR  _MAX =
MAX ( 'Table_name(1)'[_CLIENTEARNINGS] )
VAR MAX_NAME =
CALCULATE (
MAX ( 'Table_name'[_CLIENTEname] ),
FILTER ( 'Table_name', 'Table_name(1)'[_CLIENTEARNINGS] = _MAX )
)
RETURN
MAX_NAME

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.