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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
thomas_pike
Frequent Visitor

Calculation using Multiple Values for Maximum Row

Good Afternoon,

 

I am trying to create the following table using DAX:

 

IDIndexValuePitchResult
11222
12424
13626
21533
22736
23939

 

Result is a calculated column with the following formula when grouped by ID:

Pitch = Value / Index <- for the row with the max value per ID.

Result = Index * Pitch

 

What is the best way to calculate the Pitch column?

 

Thank you for your assistance

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @thomas_pike 
Please do the following https://we.tl/t-JYIy6UCpSM

1.png2.png

Pitch = 
VAR CurrentIDTable = 
    CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[ID] ) )
VAR LastIndexRecord =
    TOPN ( 1, CurrentIDTable, Data[Index] )
VAR LastIndex = 
    MAXX ( LastIndexRecord, Data[Index] )
VAR LastValue =
    MAXX ( LastIndexRecord, Data[Value] )
RETURN
    LastValue / LastIndex
Result = Data[Index] * Data[Pitch]

  

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @thomas_pike 
Please do the following https://we.tl/t-JYIy6UCpSM

1.png2.png

Pitch = 
VAR CurrentIDTable = 
    CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[ID] ) )
VAR LastIndexRecord =
    TOPN ( 1, CurrentIDTable, Data[Index] )
VAR LastIndex = 
    MAXX ( LastIndexRecord, Data[Index] )
VAR LastValue =
    MAXX ( LastIndexRecord, Data[Value] )
RETURN
    LastValue / LastIndex
Result = Data[Index] * Data[Pitch]

  

Thanks @tamerj1 that got me on the right path.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors