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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
danyeungw
Helper II
Helper II

Max or Min with Group By not working correctly with multiple years

With the following data, I want to get the max and min for January by year. It worked correctly if there is only year 2022 data. With January 2023 data, January 2022 Max and Min shows January 2023 Max and Min. I need help on the measures. Thank you.

I created 

Max = MAXX(GROUPBY(ALLSELECTED('DS'),'DS'[release_date].[Year],'DS'[release_date].[Month],'DS'[release_date].[Day]),DS[Amout])

Min = MINX(GROUPBY(ALLSELECTED('DS'),'DS'[release_date].[Year],'DS'[release_date].[Month],'DS'[release_date].[Day]),DS[Amout])

 

Expect:

       Min     Max 
2022    
 January     22.98     3164.46     (the sum of 1/3/2022)
2023    
 January     20.05     1904.51     (the sum of 1/3/2023)

 

Data:

2022  
 January 
 1502.38
 1660.98
 1596.21
 2533.24
 2804.60
 3576.31
 3795.23
 3713.29
 3412.18
 3667.45
 4251.25
 5655.53
 6401.15
 7817.37
 822.98
 9840.72
 10556.28
 11245.58
 12159.84
 13795.21
 14588.45
 15742.38
 1675.02
 17846.54
 18887.91
 19529.19
 2099.52
 21354.87
 22529.00
 2323.74
 2423.93
 25380.30
 26886.47
 27859.53
 28298.31
 29341.57
 30818.30
 31537.09
2023  
 January 
 1718.13
 1487.77
 1260.99
 1360.01
 2247.31
 240.75
 3874.91
 3870.78
 3158.82
 4847.42
 5204.94
 6572.24
 7140.25
 8100.32
 9453.19
 10271.19
 11776.77
 12527.33
 13231.27
 14264.02
 1561.35
 16236.79
 17240.69
 18780.17
 19792.64
 20391.63
 21783.50
 22405.67
 23744.64
 24439.95
 2520.05
 26581.98
 27861.77
 28497.36
 29457.56
 30405.20
 31848.13

 

2 REPLIES 2
danyeungw
Helper II
Helper II

The data table hierarchy is release_date. Thanks. 

FreemanZ
Super User
Super User

hi @danyeungw 

your dataset doesn't include [release_date] column, please consider enrich your dataset to well reflect your challenges. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors