Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Guys,
Here is my problem.
I have a line graph with last 6 months data which is default, now when I select July automaticall the line graph should show past 6 months from July, simillary if I select May the graph automatically move to 6 months past from may. I should not consider the month I selected in the graph only the past 6 months from the month I selected.
Thanks in advance.
@Drake023
Make a copy of your dates table and don't create any relationship to it, make sure your have Month-Year Column, you create like
Place that Month Year Field on a slicer for the user to choose, create the measure as
Past 6 Months =
VAR _D = EDATE(MIN('Dates2'[Date]),-6) return
IF(
MAX('DATE'[Date]) < _D || MAX('DATE'[Date]) > MIN('Dates2'[Date]),
BLANK(),
[Total Sales]
)
I selected Jan 2017, the chart shows the past 6 months
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Drake023 , Create a column like this in you date table and use that as filter
Month Type = Switch( True(),
eomonth([Date],0) <= eomonth(Today(),0) && eomonth([Date],0) >= eomonth(Today(),-6),"Last 6 Month" ,
Format([Date],"MMM-YYYY")
)
This may not work as today is considered.I want last 6 months based on user selection year and month.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |