Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Proud to be a Super User!
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?
Proud to be a Super User!
@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.
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |