cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shahinkmajeed Helper I
Helper I

Finding Max Value from a group of records

Dear All, 

 

I need help for a requirement in my work. 

 

I want to add a new column 'Max(Rate)' in the below table, which should display the max value of the 'Rate' column for particular DOC_NUM. Is there any provision for the same in Power BI without writing a sub query?. 

 

image.png

 

Expected result is:

 

image.png

 

 

Thanks in advance!!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Re: Finding Max Value from a group of records

@Shahinkmajeed

 

Try with following

 

Max Rate =
CALCULATE (
    MAX ( TableName[Rate] ),
    ALLEXCEPT ( TableName, TableName[Doc_No] )
)
Try my new Power BI game Cross the River

View solution in original post

Shahinkmajeed Helper I
Helper I

Re: Finding Max Value from a group of records

Dear Zubair,

 

Perfect. It works. Thanks a lot!!!!!!

 

 

Regards,

Shahin K

View solution in original post

4 REPLIES 4
Super User III
Super User III

Re: Finding Max Value from a group of records

@Shahinkmajeed

 

Try with following

 

Max Rate =
CALCULATE (
    MAX ( TableName[Rate] ),
    ALLEXCEPT ( TableName, TableName[Doc_No] )
)
Try my new Power BI game Cross the River

View solution in original post

Shahinkmajeed Helper I
Helper I

Re: Finding Max Value from a group of records

Dear Zubair,

 

Perfect. It works. Thanks a lot!!!!!!

 

 

Regards,

Shahin K

View solution in original post

Richard146
Frequent Visitor

Re: Finding Max Value from a group of records

This little bit of code helped me solve a problem. Thanks a stack!!

ysharma
Regular Visitor

Re: Finding Max Value from a group of records

Hi Zubair,
On what basis we decide the column after "ALLEXCEPT"? So for example in your DAX you wrote column "Doc_No", how we decide it?

Thank you in advance!

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors