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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.