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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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_CLIENT | NAME |
1 | Jack |
2 | Louise |
3 | Frank |
COD_CLIENT | EARNINGS |
2 | $4,879.03 |
1 | $271,88 |
3 | $89,764 |
Solved! Go to Solution.
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
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
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
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.