Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi All
I am new to PowerBI and delved around to try and find a solution to prevent rolling 12 charts extending on beyond todays date and pulled together the following, but i am getting an error end of input reached. I have tried changing the parent thesis but for life of me i cannot figure out what i have done wrong. Any help appreciated
Here is what i have
Solved! Go to Solution.
@Alpj , Sorry there was a mistake
use allselected
I trying to get max selected date or max available date in selection from fact- Sales in my case
@Alpj , Try a measure like
Rolling 12 Sales =
var _max = maxx(allselcted(date),date[date]) // or today()
var _max2 = maxx(allselcted(Sales),Sales[date]) //
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(SUM(Sales[Sales Amount]),filter(date, date[date] <=_max && date[date] >=_min && date[date]<=_max2 ))
or
Rolling 12 =
var _max2 = maxx(allselcted(Sales),Sales[date]) //
return
CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH), 'Date'[Date] <= _max2)
Thank you so much for responding, apologies could you explain this a little,
what is the "allselcted(date)" and "allselcted(Sales)" elements?
am i replacing date[date] with my date range table?
what is the "Sales[date]"?
Fairly new to all this, so would appreciate if you could give a little explanation
Thank you
Ali
@Alpj , Sorry there was a mistake
use allselected
I trying to get max selected date or max available date in selection from fact- Sales in my case