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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Russ
Helper I
Helper I

Max of aggregated measure by month year

Looking for the most straightforward way to calculate the max of an aggregated measure (Measure A) added to a table column by row MonthYear? MonthYear is from a calendar table, connected to the fact table by a one to many relationship on date.

 

Something like the following -

 

image.png

5 REPLIES 5
v-xicai
Community Support
Community Support

Hi @Russ ,

 

You may create measure like DAX below.

 

 

 

Max Measure A= CALCULATE(MAXX('Fact Table', [Measure A]), FILTER(ALLSELECTED(Calendar), YEAR(Calendar[Date])=YEAR(MAX(Calendar[Date]))))

 

 

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

harshnathani
Community Champion
Community Champion

@Russ ,

 

You can also try,

 

Measure = CALCULATE (MAX(Table[MeasureA]),ALL(Table)) 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

amitchandak
Super User
Super User

@Russ , try like

calculate(maxx(values(Table[MonthYear]),[Measure]),all(Table))

Many thanks, @amitchandak  @harshnathani  @v-xicai , for the replies. 

 

@amitchandak , solution works fine.

 

 @harshnathani, could not get your solution to work as Max function will only accept table column, not a measure.

 

@v-xicai , solution gives a range of results, depending on row context.

 

v-xicai
Community Support
Community Support

Hi @Russ ,

 

Yes, the MAX function will only accept table column, while the measure can be used in MAXX function instead of MAX function.

 

Best Regards,

Amy 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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