Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register 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?
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
19 | |
13 | |
11 | |
10 | |
9 |