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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rbustamante
Helper I
Helper I

How to obtain the max record for each one of the records

Hello,

I have the following table and I need DAX sentence to obtain the right table, that are the maximun values record of the left table.

rbustamante_0-1613946601024.png

Thanks in advance.

 

4 REPLIES 4
lbendlin
Super User
Super User

Please  provide more information. Should this be a calculated column or a measure?

Here is how a calculated column would look like:

Include = 
var m = CALCULATE(max('Table'[Value]),ALLEXCEPT('Table','Table'[Id]))
return if('Table'[Value]=m,1,0)
Nathaniel_C
Community Champion
Community Champion

Max.PNG

Hi @rbustamante , 

Try this:

 

Max value = 
var _curId = MAX(SourceTable[ID]) //Get Current ID
var _curValue = MAX(SourceTable[Value]) //Get current value


var _calc = CALCULATE(MAX(SourceTable[Value]),FILTER(ALLEXCEPT(SourceTable,SourceTable[ID]), MAX(SourceTable[ID])=_curId))

Return 

IF(_curValue =  _calc,_calc)

 

If you leave off the value column, and just use the measure, you will get this.

 

max1.PNG


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos ๐Ÿ‘are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for the response.

What do you mean whe you said "If you leave off the value column, and just use the measure, you will get this."?

Hi @rbustamante ,
I created the table visual from the source table with 4 columns; Group, ID, Value, Max Value.  The Max Value is the measure that I created.  This shows all the values, and blanks in the measure column.

 

If you create the table with only Group, ID, and my measure Max Value you will see that the the reduced table with no blanks that more closely matches your table to the right of Desired Result.  It just depends on what you want to show.  A measure has a much smaller footprint than a calculated column.  It just depends on what you are using these values to do.

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos ๐Ÿ‘are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)