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 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.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |