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
ezequiel
Employee
Employee

Show the first bigger value

Hi,

 

I have a table with all the days of the week and some values associated to them - Sales. Basically 2 columns. I just need to show the name of the day with the higher value on the sales column. Ideally would be to show it as a Card.

 

I can't transform the original query as I need to use other data of the table to show information (A).  And I can't have a different query for this as I need to use the same filters I'm using on (A).

 

Any help on how to solve this?

 

Thanks!

 

Ezequiel

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @ezequiel

 

If you have one value against each day, these MEASURES should give you desired result in a CARD

 

Measure =
CALCULATE (
    VALUES ( TableName[Day] ),
    FILTER ( ALL ( TableName ), TableName[sales] = MAX ( TableName[sales] ) )
)

 

Alternate Measure  =
LOOKUPVALUE ( TableName[Day], TableName[sales], MAX ( TableName[sales] ) )

Regards
Zubair

Please try my custom visuals

View solution in original post

6 REPLIES 6
v-chuncz-msft
Community Support
Community Support

@ezequiel,

 

You may use TOPN Function as well.

Measure =
MAXX ( TOPN ( 1, Table1, Table1[Sales], DESC ), Table1[Day] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Thanks for the help. I customized the measure script to my tables to

 

Measure = MAXX( TopN (1, Last_30_days_activity, Last_30_days_activity[# of Requests], desc), Last_30_days_activity[weekDay] )

 

but I'm getting a sintax error....any clue on what is wrong?

 

Thanks again

@ezequiel,

 

Replace commas ( , ) in above formula with semicolons ( ; ).

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi! didn't work...see attached error. Thanks!

 

Capture.JPG

@ezequiel,

 

Your original formula seems correct. If convenient, share us the simplified model.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Zubair_Muhammad
Community Champion
Community Champion

Hi @ezequiel

 

If you have one value against each day, these MEASURES should give you desired result in a CARD

 

Measure =
CALCULATE (
    VALUES ( TableName[Day] ),
    FILTER ( ALL ( TableName ), TableName[sales] = MAX ( TableName[sales] ) )
)

 

Alternate Measure  =
LOOKUPVALUE ( TableName[Day], TableName[sales], MAX ( TableName[sales] ) )

Regards
Zubair

Please try my custom visuals

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.