Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
StevenT
Resolver I
Resolver I

minimum value working, max not working

Hi, I'm using a min and max to use in my KPI. The minimum works fine, but for some reason the maximum isn't giving me the maximum value.

The highest value in the table is  1231 and it's incorrect in KPI progress
The lowest value is 76 and it's correct in the KPI Progress visual

Sorted by highest

StevenT_1-1730154741340.png

Sorted by Lowest

StevenT_3-1730154806787.png

 

 

Min Measure

VAR SummaryTable =
    SUMMARIZE(
        ALL('TrackSales'),  -- Use ALL to remove filters on the entire table
        'TrackSales'[fkTrackList],
        "TotalSales", SUM('TrackSales'[SalesAmt])
    )
RETURN
    MINX(SummaryTable, [TotalSales])

Max Measure (this one is returning incorrect values).
    VAR SummaryTable =
    SUMMARIZE(
        ALL('TrackSales'),  -- Use ALL to remove filters on the entire table
        'TrackSales'[fkTrackList],
        "TotalSales", SUM('TrackSales'[SalesAmt])
    )
RETURN
MAXX(SummaryTable, [TotalSales])
___________________________________________________________________________
So what do you think I'm doing wrong?  Kind of stumped.
Thanks, Steven Taub
3 REPLIES 3
PhilipTreacy
Super User
Super User

@StevenT 

 

Isn't the top chart a gauge?  If so just drag the Sales field into the Min and max wells and choose Min and Max as the aggregation?

 

PhilipTreacy_0-1730158721000.png

 

If you have to write measures you can use

 

Min Sales = MIN(ALL('DataTable'[Sales]))
Min Sales = MAX(ALL('DataTable'[Sales]))

 

 

Regards

 

Phil

 

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


That won't work in this case.  I have to basically calculate multiple sales and aggregate them together to discover the largest and smallest $.

@StevenT 

 

Please supply some sample data so that we know what you are working with and understand how you are getting the MAX and MIN values shown in your visual.

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.