Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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?
Thank you in advance!
Kostas
Solved! Go to Solution.
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
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.
Hi @kostask ,
How about this:
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! | |
#proudtobeasuperuser | |
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
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |