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,
I'm totally new to power BI.
I'm trying to filter date range of the line chart using a tree map filter as "In the last 1 month, 2 months, 3 months, 6 months, 1 year, and 2 years". That is if I click on 1 month the line grapgh should show last 1 month data from today.
but It does not change when clicking 1month. Can you all please help.
Solved! Go to Solution.
@Anonymous , In this case, your date range needs to be bigger than the selected period else you need independent date slicer
var _max = if(SELECTEDVALUE(Period[PeriodType],"MTD") = "Yesterday",MAX( 'Date'[Date])-1 , today()-1)
var _min =
SWITCH(SELECTEDVALUE(Period[PeriodType],"MTD"), //selected by tree map
"YTD",eomonth(_max,-1*MONTH(_max))+1 , //FY April -March
"FYTD",if( Month(_max) <4 , date(year(_max)-1,4,1) ,date(year(_max),4,1)), //FY April -March
"QTD",eomonth(_max,-1* if( mod(Month(_max),3) =0,3,Month(_max)))+1,
"MTD",eomonth(_max,-1)+1 ,
"2 Month", date(Year(_max), month(_max) -3, Day(_max))+1,
"3 Month", date(Year(_max), month(_max) -3, Day(_max))+1,
"6 Month", date(Year(_max), month(_max) -6, Day(_max))+1,
"12 Month", date(Year(_max), month(_max) -12, Day(_max))+1,
BLANK())
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
In case you select a range small then what you want
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Hi @Anonymous,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@Anonymous , In this case, your date range needs to be bigger than the selected period else you need independent date slicer
var _max = if(SELECTEDVALUE(Period[PeriodType],"MTD") = "Yesterday",MAX( 'Date'[Date])-1 , today()-1)
var _min =
SWITCH(SELECTEDVALUE(Period[PeriodType],"MTD"), //selected by tree map
"YTD",eomonth(_max,-1*MONTH(_max))+1 , //FY April -March
"FYTD",if( Month(_max) <4 , date(year(_max)-1,4,1) ,date(year(_max),4,1)), //FY April -March
"QTD",eomonth(_max,-1* if( mod(Month(_max),3) =0,3,Month(_max)))+1,
"MTD",eomonth(_max,-1)+1 ,
"2 Month", date(Year(_max), month(_max) -3, Day(_max))+1,
"3 Month", date(Year(_max), month(_max) -3, Day(_max))+1,
"6 Month", date(Year(_max), month(_max) -6, Day(_max))+1,
"12 Month", date(Year(_max), month(_max) -12, Day(_max))+1,
BLANK())
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
In case you select a range small then what you want
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.