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
kostask
Helper II
Helper II

Calculated Column Based on Max Index of other Column

Hi guys.

I want to create a calculated column based on the Max index number of another column.

Specifically for the table below:

For the combination Attribute 1 - Attribute 2 (ex A-X),  to have the result of the amount (ie 10) next to the max Index ( ie 3),

and the others as blanks.

For B-Z, amount 24 next to Index 6 etc.

Is it possible?

11.PNG

 

Thank you in advance!

Kostas

1 ACCEPTED SOLUTION
Dhacd
Resolver III
Resolver III

Hi @kostask 

Please try the dax code provided below as a calculated column.

Max Amount = 
Var Attribute1= 'Table'[Attribute 1]
Var Attribute2= 'Table'[Attribute 2]
Var AttributeFilter = Filter('Table','Table'[Attribute 1] =Attribute1 && 'Table'[Attribute 2] =Attribute2)
Var IndexMax = Calculate(max('Table'[Index]),AttributeFilter)
Var Result = If(IndexMax= 'Table'[Index],'Table'[Amount],BLANK())

Return Result

 

Dhacd_0-1657616948744.png

If this doesn't solve your problem please give an update so that I can work on it.


If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.

View solution in original post

3 REPLIES 3
Dhacd
Resolver III
Resolver III

Hi @kostask 

Please try the dax code provided below as a calculated column.

Max Amount = 
Var Attribute1= 'Table'[Attribute 1]
Var Attribute2= 'Table'[Attribute 2]
Var AttributeFilter = Filter('Table','Table'[Attribute 1] =Attribute1 && 'Table'[Attribute 2] =Attribute2)
Var IndexMax = Calculate(max('Table'[Index]),AttributeFilter)
Var Result = If(IndexMax= 'Table'[Index],'Table'[Amount],BLANK())

Return Result

 

Dhacd_0-1657616948744.png

If this doesn't solve your problem please give an update so that I can work on it.


If this post helps, then please consider accepting it as the solution to help the other members find it more quickly.
Regards,
Atma.

tackytechtom
Super User
Super User

Hi @kostask ,

 

How about this:

tomfox_0-1657617628693.png

 

Here the DAX code for the calculated column:

Result = 
IF ( 
    RANKX ( 
        FILTER ( 
            'Table', 
            'Table'[Attribute1] = EARLIER ( 'Table'[Attribute1] ) && 'Table'[Attribute2] = EARLIER ( 'Table'[Attribute2] )
        ),
        'Table'[Index],
        , DESC
        , DENSE
    ) = 1, 
    Table[Amount],
    BLANK()
)

 

Let me know if this helps ๐Ÿ™‚

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your questionโ“โžก๏ธ Please, mark my post as a solution โœ”๏ธ

Also happily accepting Kudos ๐Ÿ™‚

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

kostask
Helper II
Helper II

Great work!

Thank you @Dhacd 

Kostas

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)