Forum Discussion
How I can filter this line chart correctly
I'm working on a project. I had a correction that the line graph at the bottom should only reflect years. But, when applying a filter by years, show me each month of that year in that graph. Do they have any recommendations?
- Anonymous1 year ago
Hi Syndicate_Admin ,
Based on your description, first use the date hierarchy as your x-axis, then you can use the Expand All Fields at Once feature in the drill-down function, and finally select the year you need on your filter
Drill mode in the Power BI service - Power BI | Microsoft Learn
Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
4 Replies
- Bibiano_Geraldo
Super User
Hi Syndicate_Admin ,
Instead of using date hierarchy, create a new year date column in your calendar table using the bellow code:
Year = FORMAT(Calendario[Date],"yyyy")make sure thatt the data type is set to whole number:
Now place this new created column under X-axis and remove the date column in x-axis.
- Syndicate_Admin
Administrator
The drawback is that, when I apply the date filter, it only shows me one point on the graph, corresponding to that year. As directed, it should show every month of that year. I attach what it shows me when filtering a specific year using the predicted risk filter.
- Bibiano_Geraldo
Super User
Understood, in this case with your original date hierarchy, you will have to drill down when the year is selected.
- AnonymousNot applicable
Hi Syndicate_Admin ,
Based on your description, first use the date hierarchy as your x-axis, then you can use the Expand All Fields at Once feature in the drill-down function, and finally select the year you need on your filter
Drill mode in the Power BI service - Power BI | Microsoft Learn
Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly