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 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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 35 | |
| 34 | |
| 27 |
| User | Count |
|---|---|
| 137 | |
| 97 | |
| 74 | |
| 66 | |
| 65 |