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

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors