Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I need to design a custom visual of a line chart that has the option to change the year. Consider the following dummy data.
All the years in our xValue need to be displayed and the user chooses which year to display and the corresponding line chart is plotted. Is it possible to this in powerbi.
Thanks in advance
Solved! Go to Solution.
Hi. I will suggest something but it might be a good idea to read more about data modeling because using a Calendar Table will help you with any visualizations or DAX calculation regarding time/date.
If you just want to build this you first need to create a new column that will contain the year. You can do it on power query with operations like "text after delimiter". Delimiter can be white space. You can also do a "Extract last characters" using last 4.
Once you have that third year column you can create a line chart with Axis = xValue and Values = Sales. Then add a Slicer visualization with the Year (you can change the way it is build with the small down arrow when you mouse over the visual). I like the list of dropdownlist for this scenario to let the user change year by year the line chart.
I hope that helps.
Happy to help!
Hi @Anonymous ,
According to your description, just put the year field in the slicer. I did the following test:
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, just put the year field in the slicer. I did the following test:
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi. I will suggest something but it might be a good idea to read more about data modeling because using a Calendar Table will help you with any visualizations or DAX calculation regarding time/date.
If you just want to build this you first need to create a new column that will contain the year. You can do it on power query with operations like "text after delimiter". Delimiter can be white space. You can also do a "Extract last characters" using last 4.
Once you have that third year column you can create a line chart with Axis = xValue and Values = Sales. Then add a Slicer visualization with the Year (you can change the way it is build with the small down arrow when you mouse over the visual). I like the list of dropdownlist for this scenario to let the user change year by year the line chart.
I hope that helps.
Happy to help!