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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
trying
Frequent Visitor

Max Value of Measure

Hi all,

 

i am struggeling to get the max value of the measure i have written here:

 

Total Complaints | Last 12 Months =
var maxDate = LASTDATE('Calendar'[Date])
var minDate = FIRSTDATE('Calendar'[Date])
Return
CALCULATE([cpm (complaints per millions)],
Filter('Calendar_helper','Calendar_helper'[Date]<=maxDate &&
'Calendar_helper'[Date]>=DATEADD(minDate,-12,MONTH)),
ALL('Calendar')
)
 
Can anyone help?
 
Thanks in advance and KR,
Daniel
1 ACCEPTED SOLUTION

Measure = 

Var T1 =

	Summarize(
		calendar, YearMonth, "_Value", [cpm (complaints per millions)]
	) // This should return a table with months and the corresponding cpm.
	  // you'll have to limit the data to the last 12 months
	  // Maybe with a FILTER on the calender in the first argument in summarize or on T1

Var _Max = 
maxx(
	T1, _value)


To be more specific i'd need a .pbix for testing

View solution in original post

3 REPLIES 3
NickolajJessen
Solution Sage
Solution Sage

I'm not sure what you are trying to accomplish, but where a link with 5 ways to do rolling 12 month 😊!

https://gorilla.bi/dax/5-ways-to-calculate-last-12-months-in-dax/

If this post solves your problem, accept it as a solution
Appreciate your kudos

thanks for the reply! I try to get the max value for the measure up above. Meaning which is the max value within those 12 months i have in the measure.

 

 

Measure = 

Var T1 =

	Summarize(
		calendar, YearMonth, "_Value", [cpm (complaints per millions)]
	) // This should return a table with months and the corresponding cpm.
	  // you'll have to limit the data to the last 12 months
	  // Maybe with a FILTER on the calender in the first argument in summarize or on T1

Var _Max = 
maxx(
	T1, _value)


To be more specific i'd need a .pbix for testing

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.