Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
113 | |
69 | |
59 | |
46 |