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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Dear Power BI Pros,
I need your urgent help on finding the max value.
I want to get the index of max KG.
KG is my measure.
Thank you!
Solved! Go to Solution.
Dear @tamerj1 ,
Thank you so much for your response!
KG is not a column, it is a measure, could pls you suggest me how to pass KG measure inside calculatetable.
Hi @Newbie12345
please try
Expected Output =
VAR T =
GENERATE (
VALUES ( 'Table'[Category] ),
CALCULATETABLE (
TOPN ( 1, SUMMARIZE ( 'Table', 'Table'[Kg], 'Table'[Index] ), 'Table'[Kg] ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)
)
RETURN
MAXX ( T, 'Table'[Index] )
Dear @tamerj1 ,
Thank you so much for your response!
KG is not a column, it is a measure, could pls you suggest me how to pass KG measure inside calculatetable.
Please try
Expected Output =
VAR T =
GENERATE (
VALUES ( 'Table'[Category] ),
CALCULATETABLE (
TOPN ( 1, SUMMARIZE ( 'Table', 'Table'[Index] ), [Kg] ),
ALL ( 'Table'[Index] )
)
)
RETURN
MAXX ( T, 'Table'[Index] )
To find the index of the maximum value of a measure in Power BI, you can use the DAX function MAXX along with FILTER to iterate through the table and find the row with the highest ‘KG’ value. Here’s an example of how you might write this measure:
MaxKGIndex = VAR MaxKGValue = MAXX(ALL(Table1), [KG]) RETURN CALCULATE( MIN(Table1[Index]), FILTER( ALL(Table1), [KG] = MaxKGValue ) )
This measure calculates the maximum ‘KG’ value across all rows in ‘Table1’ and then finds the corresponding ‘Index’ where this maximum value occurs. The ALL function is used to remove any filters that might limit the rows being evaluated. Remember to replace ‘Table1’ with the actual name of your table.
Please note that if there are multiple rows with the same maximum ‘KG’ value, this measure will return the smallest index among them. If you need further assistance or have more specific requirements, feel free to ask! 😊
Dear @AnalyticsWizard
Thank you so much for your response.
I tried it, unfortunately it is saying 'Visual is exceeded the available resourses' even after selecting single category.
Could you please help around with this?