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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi everyone, i need to print the city with maximum avg value. i tried applying max function on avg measure its showing me an error. can someone help on how to show to calculate and show the max avg value using DAX?. i added image of list of avg's of all cities below.
Solved! Go to Solution.
My understanding is that ultimately you want to compare the average of each city with maximum and minimum averages of all cities. In order to do that you want to add two measures to your matrix. One for minimum average and one for maximum average. The value of the maximum average for example will be the same for all rows. Same for minimum average. Then you can take the difference and maybe percentage. I hope I'm right. Then you can use
Maximum Average =
MAXX ( ALL ( Table[City] ), [Z-Avg air Quality] )
Minimum Average =
MINX ( ALL ( Table[City] ), [Z-Avg air Quality] )
My understanding is that ultimately you want to compare the average of each city with maximum and minimum averages of all cities. In order to do that you want to add two measures to your matrix. One for minimum average and one for maximum average. The value of the maximum average for example will be the same for all rows. Same for minimum average. Then you can take the difference and maybe percentage. I hope I'm right. Then you can use
Maximum Average =
MAXX ( ALL ( Table[City] ), [Z-Avg air Quality] )
Minimum Average =
MINX ( ALL ( Table[City] ), [Z-Avg air Quality] )
@Hemanth_Vinay , assume you have measure = [Z-Avg Quality Index] or create and use a measure
calculate(MAxx(Values(Table[City]) , [Z-Avg Quality Index])
or
if this is a column -Z-Avg Quality Index
calculate(MAxx(Values(Table[City]) ,calculate(Average(Table [Z-Avg Quality Index])))
Hi @amitchandak thanks for helping me out but by using dax function which you have provided, i could only calculate average of each city, but what i want show is a single value of which city has the lowest or highest average.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.