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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 121 | |
| 103 | |
| 46 | |
| 30 | |
| 24 |