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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.