Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi there,
In the following line chart, how can I limit x axis till 3 months ago from the current month: that is Aug FY23 (FY is from 1st July to 30th June) being the current month, I want to show the x axis till May FY22 only.
Thanks for your help.
Solved! Go to Solution.
Hi @KoalaPBI.
Try below as a calculated column in your dates table if you have one otherwise in your facts table. This will return TRUE/FALSE. You can then use this column to filter your visual.
Within 3 months =
VAR CurrentMonthStart =
EOMONTH ( TODAY (), -1 ) + 1 //get the start of the month
VAR ThreeMonthsAgo =
EDATE ( CurrentMonthStart, -3 ) //3 months earlier from the start of the month
RETURN
Dates[Date] >= ThreeMonthsAgo
Try below as a measure.
Value within 3 mos =
VAR CurrentMonthStart =
EOMONTH ( TODAY (), -1 ) + 1 //get the start of the current month
VAR ThreeMonthsAgo =
EDATE ( CurrentMonthStart, -3 ) //3 months earlier start of the current month
RETURN
CALCULATE ( [original measure], FILTER ( Dates, Dates[Date] >= ThreeMonthsAgo ) )
Take note TODAY will update in your next dataset refresh.
Hi @KoalaPBI !
I can think of two options:
1/ You select the visual and filter relative date last three months.
2/ Adapt the measure to only show the values of the last three months.
Could you try the first option and let us know if that did the trick?
Hope it helped!
Kind regards,
OD
Hi,
You should create a Calendar Table and follow @OzkanDhont first suggestion. It will work.
Hi @KoalaPBI ,
What does your current month mean here? Is it the actual calendar month as of today or based on a slicer selection?
@danextian current month is the actual calendar month as of today. There is no date slicer.
Hi @KoalaPBI.
Try below as a calculated column in your dates table if you have one otherwise in your facts table. This will return TRUE/FALSE. You can then use this column to filter your visual.
Within 3 months =
VAR CurrentMonthStart =
EOMONTH ( TODAY (), -1 ) + 1 //get the start of the month
VAR ThreeMonthsAgo =
EDATE ( CurrentMonthStart, -3 ) //3 months earlier from the start of the month
RETURN
Dates[Date] >= ThreeMonthsAgo
Try below as a measure.
Value within 3 mos =
VAR CurrentMonthStart =
EOMONTH ( TODAY (), -1 ) + 1 //get the start of the current month
VAR ThreeMonthsAgo =
EDATE ( CurrentMonthStart, -3 ) //3 months earlier start of the current month
RETURN
CALCULATE ( [original measure], FILTER ( Dates, Dates[Date] >= ThreeMonthsAgo ) )
Take note TODAY will update in your next dataset refresh.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
51 | |
42 | |
40 |