Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Interactive Line Chart

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.

Screenshot from 2021-07-05 16-54-46.png

 

 

 

 

 

 

 

 

 

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

2 ACCEPTED SOLUTIONS
ibarrau
Super User
Super User

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.


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, just put the year field in the slicer. I did the following test:

vhenrykmstf_0-1625627558567.png

vhenrykmstf_1-1625627570936.png


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.

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, just put the year field in the slicer. I did the following test:

vhenrykmstf_0-1625627558567.png

vhenrykmstf_1-1625627570936.png


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.

ibarrau
Super User
Super User

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.


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.