cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ezequiel Regular Visitor
Regular Visitor

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

Accepted Solutions
Super User III
Super User III

Re: Show the first bigger value

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] ) )
Try my new Power BI game Cross the River

View solution in original post

6 REPLIES 6
Super User III
Super User III

Re: Show the first bigger value

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] ) )
Try my new Power BI game Cross the River

View solution in original post

Community Support Team
Community Support Team

Re: Show the first bigger value

@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.
ezequiel Regular Visitor
Regular Visitor

Re: Show the first bigger value

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

Community Support Team
Community Support Team

Re: Show the first bigger value

@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.
ezequiel Regular Visitor
Regular Visitor

Re: Show the first bigger value

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

 

Capture.JPG

Community Support Team
Community Support Team

Re: Show the first bigger value

@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.

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors