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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.