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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors