Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I'm having trouble using measure to get max and min.
I only have one table with a column of id and a date (at the moment i have 300k id at the 1st august + the same 300k id at the 1st september).
The result I want is to show the count of id from M1 and M2, both month can be selected by the user.
First, i put a filter on the screen to allow the user to select months (I only showed month + year but it's a full date in the table)
The solution I imagined is to get the max month in a measure and the min month in another :
Solved! Go to Solution.
@Scaart , Not very clear , one way is time intelligenec
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
another one is
Min month
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
calculate( sum(Table[Value]), filter('Date', eomonth('Date'[Date],0) >=eomonth(_min,0) ))
Max month
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
calculate( sum(Table[Value]), filter('Date', eomonth('Date'[Date],0) >=eomonth(_max,0) ))
@Scaart , Not very clear , one way is time intelligenec
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
another one is
Min month
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
calculate( sum(Table[Value]), filter('Date', eomonth('Date'[Date],0) >=eomonth(_min,0) ))
Max month
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
calculate( sum(Table[Value]), filter('Date', eomonth('Date'[Date],0) >=eomonth(_max,0) ))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.