Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I am looking to create a new column where the formula pulls the value in column C, based off the highest value in column B. Also, this needs to be done by each portfolio code (column A).
Example #1, portfolio code "30022", the highest value in column B is 5. The new column I am trying to create should pull in the value from column C which is 50. But this should pull in for all rows that contain portfolio code 30022.
Example #2, portfolio code "30015", the highest value in column B is 4. The new column I am trying to create should pull in the value from column C which is 25. But this should pull in for all rows that contain portfolio code 30015.
Solved! Go to Solution.
HI @gmasta1129 ,
You can achieve your goal by creating a new calculated colum using the following DAX:
New Column =
VAR MaxValue =
CALCULATE(
MAX('Table'[Value]),
ALLEXCEPT('Table', 'Table'[Portfolio Code Value])
)
RETURN
CALCULATE(
MAX('Table'[Value #2]),
'Table'[Value] = MaxValue,
ALLEXCEPT('Table', 'Table'[Portfolio Code Value])
)
Your table now should look like this:
Hi,
Write this calculated column formula
Column = LOOKUPVALUE(Data[Value #2],Data[Value],CALCULATE(max(Data[Value]),FILTER(Data,Data[Portfolio Code]=EARLIER(Data[Portfolio Code]))),Data[Portfolio Code],Data[Portfolio Code])
Hope this helps.
Hi,
Write this calculated column formula
Column = LOOKUPVALUE(Data[Value #2],Data[Value],CALCULATE(max(Data[Value]),FILTER(Data,Data[Portfolio Code]=EARLIER(Data[Portfolio Code]))),Data[Portfolio Code],Data[Portfolio Code])
Hope this helps.
HI @gmasta1129 ,
You can achieve your goal by creating a new calculated colum using the following DAX:
New Column =
VAR MaxValue =
CALCULATE(
MAX('Table'[Value]),
ALLEXCEPT('Table', 'Table'[Portfolio Code Value])
)
RETURN
CALCULATE(
MAX('Table'[Value #2]),
'Table'[Value] = MaxValue,
ALLEXCEPT('Table', 'Table'[Portfolio Code Value])
)
Your table now should look like this:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |